-
Notifications
You must be signed in to change notification settings - Fork 25
fix: Error handling in StreamingBatchWriter #1921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
defer func() { | ||
err := w.Close(ctx) | ||
retErr = errors.Join(retErr, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New improvement: always do w.Close even we returned an error, and join errors.
Getting the S3 plugin ready for the [StreamingBatchWriter update](cloudquery/plugin-sdk#1921). ~Incorporates cloudquery/filetypes#579 and cloudquery/plugin-sdk#1921
Should be merged after merging: |
Getting the GCS plugin ready for the [StreamingBatchWriter update](cloudquery/plugin-sdk#1921). ~Incorporates cloudquery/filetypes#579 and cloudquery/plugin-sdk#1921
Getting the azblob plugin ready for the [StreamingBatchWriter update](cloudquery/plugin-sdk#1921). ~Incorporates cloudquery/filetypes#579 and cloudquery/plugin-sdk#1921
Getting the file plugin ready for the [StreamingBatchWriter update](cloudquery/plugin-sdk#1921). ~Incorporates cloudquery/filetypes#579 and cloudquery/plugin-sdk#1921
} | ||
} | ||
|
||
return w.Close(ctx) | ||
return errors.Join(errs...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we collate the errors from errCh
, as well as logging them as they are encountered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and fixes stuck syncs issues for stuck syncs in s3 plugin 🚀
🤖 I have created a release *beep* *boop* --- ## [4.84.2](v4.84.1...v4.84.2) (2025-06-18) ### Bug Fixes * Add time delay in DeleteStaleAll test for destinations ([#2191](#2191)) ([d98a293](d98a293)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/config to v1.29.15 ([#2189](#2189)) ([9860e20](9860e20)) * **deps:** Update module github.com/aws/aws-sdk-go-v2/service/licensemanager to v1.31.1 ([#2186](#2186)) ([7647d77](7647d77)) * **deps:** Update module google.golang.org/grpc to v1.72.2 ([#2187](#2187)) ([a999c81](a999c81)) * **deps:** Update module google.golang.org/grpc to v1.73.0 ([#2190](#2190)) ([2e3c192](2e3c192)) * Error handling in StreamingBatchWriter ([#1921](#1921)) ([6d71fb1](6d71fb1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
original PR: #1913
Reverts the revertion, plus more improvements:
ensureOpened()
inline-func now got refactored intos.send()
and handles the sending as well). The spawned goroutine doesn't refer toinputCh
directly so that it can be replaced incloseFlush()
.client.Write()
returns an error aftermsgs
is closed, it's still logged and returned.