-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(client): add call timeout to log stream appender #474
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Codecov ReportPatch coverage has no change and project coverage change:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## lsa_close_in_callback #474 +/- ##
=========================================================
- Coverage 62.65% 62.49% -0.17%
=========================================================
Files 133 133
Lines 18372 18415 +43
=========================================================
- Hits 11511 11508 -3
- Misses 6291 6340 +49
+ Partials 570 567 -3
☔ View full report in Codecov by Sentry. |
This PR adds a call timeout to the log stream appender. It helps the log stream appender not to be blocked. LogStreamAppender can be blocked at the following points: - (a) Waiting for the pipeline to have room - (b) Flow-controlled when calling RPC - (c) Stucked server - (d) Slow callback ``` +------+ +-------------------------+ +--------+ | | | LogStreamAppender | | | | | | | | | | | | (a)----------------(b) | | | | +--AppendBatch--->| pipeline queue |--gRPC request->| | | User | | +----------------+ | | | | code | | | | Varlog | | | | +----------------+ | | | | | | | callback | | | | | |<--Callback-+----| processing |<-gRPC response-+ | | | | (c) goroutine (d) | | | | | | +----------------+ | | | +------+ +-------------------------+ +--------+ ``` When a user configures call timeout by using `pkg/varlog.WithCallTimeout`, the `pkg/varlog.(LogStreamAppender).AppendBatch` or its callback function can return ErrCallTimeout when above situations.
869135d
to
77b8de8
Compare
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.
simple & light! good!
What this PR does
This PR adds a call timeout to the log stream appender. It helps the log stream appender not to be
blocked. LogStreamAppender can be blocked at the following points:
When a user configures call timeout by using
pkg/varlog.WithCallTimeout
, thepkg/varlog.(LogStreamAppender).AppendBatch
or its callback function can return ErrCallTimeout whenabove situations.