Converge CancelCheckInterval into a common constant#143
Open
yushan8 wants to merge 7 commits into
Open
Conversation
sbalabanov
requested changes
Jul 6, 2026
sywhang
reviewed
Jul 6, 2026
931eceb to
35ec09a
Compare
liujsj
reviewed
Jul 8, 2026
| // CancelCheckInterval is how often we poll ctx.Err() inside per-target hot loops. | ||
| // Picked to keep overhead negligible while still surfacing cancellation in <100ms | ||
| // for typical target rates. | ||
| CancelCheckInterval = 4096 |
There was a problem hiding this comment.
Prior we were using 1024 with this comment. Should we not converge on the smaller of the two? The cost of doing the check is almost negligible?
liujsj
reviewed
Jul 8, 2026
| @@ -0,0 +1,8 @@ | |||
| package errors | |||
There was a problem hiding this comment.
Is this really an error package? Should it be some constant package instead
liujsj
reviewed
Jul 8, 2026
|
|
||
| // chunk targets into multiple messages for streaming | ||
| responses := chunkTargets(optimizedTargets, DefaultTargetChunkSize) | ||
| responses := chunkTargets(optimizedTargets, config.DefaultTargetChunkSize) |
There was a problem hiding this comment.
Why does this not use the service config value? If someone specified in their config, then it would get ignored here and instead use the default value still.
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.
Converge CancelCheckInterval into a common constant. Move service related constants to service_config.go.