Skip to content

fix: Concurrent map access when reporting remote progress#21108

Merged
kodiakhq[bot] merged 2 commits intomainfrom
fix/concurrent_map_access_statsPerTable
Jul 24, 2025
Merged

fix: Concurrent map access when reporting remote progress#21108
kodiakhq[bot] merged 2 commits intomainfrom
fix/concurrent_map_access_statsPerTable

Conversation

@erezrokah
Copy link
Copy Markdown
Member

Summary

Our race detection tests didn't catch this since we only report remote progress for sync runs API keys

if authClient.GetTokenType() != auth.SyncRunAPIKey {

I'll follow up with a test later

@erezrokah erezrokah requested a review from a team as a code owner July 24, 2025 09:19
@erezrokah erezrokah requested a review from murarustefaan July 24, 2025 09:19
Errors: int64(totals.Errors),
Warnings: int64(totals.Warnings),
Status: &status,
TableProgress: &statsPerTable,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The progress reporting runs in a separate Go routine than the sync one, hence the race

@erezrokah erezrokah added automerge Automatically merge once required checks pass priority merge labels Jul 24, 2025
@kodiakhq kodiakhq bot merged commit 189a8c3 into main Jul 24, 2025
18 checks passed
@kodiakhq kodiakhq bot deleted the fix/concurrent_map_access_statsPerTable branch July 24, 2025 09:33
erezrokah pushed a commit that referenced this pull request Jul 24, 2025
🤖 I have created a release *beep* *boop*
---


##
[6.24.2](cli-v6.24.1...cli-v6.24.2)
(2025-07-24)


### Bug Fixes

* Concurrent map access when reporting remote progress
([#21108](#21108))
([189a8c3](189a8c3))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
erezrokah added a commit that referenced this pull request Jul 24, 2025
<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->

#### Summary

Follow up to #21108.

This was a bit tricky as we need to list and download plugins from the
real API, and mock the progress reporting endpoint as we don't really
have a sync run to report progress for.

<!--
Use the following steps to ensure your PR is ready to be reviewed

- [ ] Read the [contribution
guidelines](https://github.com/cloudquery/cloudquery/blob/main/CONTRIBUTING.md)
🧑‍🎓
- [ ] Run `make lint` to ensure the proposed changes follow the coding
style 🚨 (install golangci-lint
[here](https://golangci-lint.run/usage/install/#local-installation))
- [ ] Run `make test` to ensure the proposed changes pass the tests 🧪
- [ ] If changing a source plugin run `make gen` to ensure docs are up
to date 📝
- [ ] Ensure the status checks below are successful ✅
--->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli automerge Automatically merge once required checks pass priority merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants