Skip to content

fix: Prevent concurrent map read & write in snowflake write function#5452

Merged
kodiakhq[bot] merged 2 commits intomainfrom
fix-snowflake-concurrent-map-access
Dec 7, 2022
Merged

fix: Prevent concurrent map read & write in snowflake write function#5452
kodiakhq[bot] merged 2 commits intomainfrom
fix-snowflake-concurrent-map-access

Conversation

@hermanschaaf
Copy link
Copy Markdown
Contributor

This happens rarely, but sometimes the workers map gets accessed by the goroutine while the loop is still writing to the map, which causes a panic.

@hermanschaaf hermanschaaf requested review from a team, cqgaurav and yevgenypats and removed request for a team and cqgaurav December 6, 2022 19:17
Copy link
Copy Markdown
Contributor

@yevgenypats yevgenypats left a comment

Choose a reason for hiding this comment

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

Looks good. I think I need to update the destination plugin API to always batch by tables. This will simplify the implementation for all destination plugins. Also, this will solve the annoying thing on PostgreSQL and other destination where we can't know which table caused the error 😆

@hermanschaaf hermanschaaf added the automerge Automatically merge once required checks pass label Dec 7, 2022
@kodiakhq kodiakhq bot merged commit a6a74de into main Dec 7, 2022
@kodiakhq kodiakhq bot deleted the fix-snowflake-concurrent-map-access branch December 7, 2022 09:16
kodiakhq bot pushed a commit that referenced this pull request Dec 7, 2022
🤖 I have created a release *beep* *boop*
---


## [1.0.5](plugins-destination-snowflake-v1.0.4...plugins-destination-snowflake-v1.0.5) (2022-12-07)


### Bug Fixes

* **deps:** Update module github.com/cloudquery/plugin-sdk to v1.11.1 ([#5458](#5458)) ([58b7432](58b7432))
* Prevent concurrent map read & write in snowflake write function ([#5452](#5452)) ([a6a74de](a6a74de))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants