-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add Flush Timeout to s3 Connector #553
Conversation
* Make `_s3_resource` a cached property. * Move s3 session and resource creation into `setup()` method so that task for `flush_timeout` can be scheduled properly.
* Adapt task scheduling unit test to not interfere with local opensearch instance
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #553 +/- ##
==========================================
+ Coverage 94.39% 94.44% +0.04%
==========================================
Files 144 143 -1
Lines 10047 10075 +28
==========================================
+ Hits 9484 9515 +31
+ Misses 563 560 -3 ☔ View full report in Codecov by Sentry. |
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.
thank you for your contribution.
I found some minor issues. Please have a look.
Mostly missing type hints. Please consider to scan the touched files for missing type hints I did not catch
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.
sorry... wrong button. Please consider to fix the issues mentioned above
* Make `_build_no_prefix_document` non-static and use internal `_encoder` to encode document
This PR adds the
flush_timeout
configuration option to theS3Output
connector.When the specified
flush_timeout
interval expires, the s3 connector will write all backlog elements, regardless whether the message backlog is actually full or not.This prevents the connector from holding onto logs forever, if there are no new logs to process and the configured backlog size is not reached.
Changelog:
flush_timeout
configuration option for theS3Output
connectorsetup
method where_write_backlog
is scheduled_s3_resource
a cached propertysetup
method to check whether the specifiedbucket
is accessible_handle_s3_error
decorator to handle all boto3 and boto-core related exceptions.