fix: Fix lack of error on destination close.#19178
Merged
marianogappa merged 2 commits intomainfrom Sep 18, 2024
Merged
Conversation
erezrokah
approved these changes
Sep 18, 2024
disq
approved these changes
Sep 18, 2024
kodiakhq bot
pushed a commit
that referenced
this pull request
Sep 19, 2024
🤖 I have created a release *beep* *boop* --- ## [6.7.1](cli-v6.7.0...cli-v6.7.1) (2024-09-19) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.22.3 ([#19171](#19171)) ([c690a76](c690a76)) * **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.63.0 ([#19176](#19176)) ([00b2de0](00b2de0)) * Don't interleave send calls from difference Go routines ([#19209](#19209)) ([d6dc789](d6dc789)) * Fix lack of error on destination close. ([#19178](#19178)) ([c11ad21](c11ad21)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@murarustefaan reported a new issue on syncs, where closing a destination plugin results in the sync continuing to process source records until the end (but doing nothing with them), and then finishing with an error. This only happens on certain sync configurations.
The issue is happening because of two reasons:
cloudquery/cli/internal/transformerpipeline/pipeline.go
Line 75 in e151df2
io.EOFpropagates forwards to finalise the sync). An error also closes the pipeline, but due to the first bullet point, it doesn't error the sync.As a result, when the destination errors, the source happily sends all records to the ether, and when done, the sync does error.
The fix is just to error when a send is sent to a closed pipeline.
The following video reproduces the error, installs the fix and shows how it behaves correctly after:
demo-bugfix.mov