You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you instead use errGroup to do the same thing?
Yes, that works. I’ve implemented the same logic using an errgroup with context—please review code again.
Also, a quick question: since we’re using egCtx (from errgroup.WithContext(ctx)),
it already inherits all features from the parent ctx, including cancellation and timeouts.
In handleUidPostings, there’s still a check on the parent ctx every 100 iterations (around line 812 in worker/task.go).
Given that, is this check still necessary, or is there a specific reason for keeping it?
If we don't have that check, it could take a long time for a thread to finish as this one thread with no errors could take long when other threads have been cancelled.
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
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.
Description
This PR optimizes goroutine execution in multi-task scenarios:
This improves system responsiveness and reduces wasted CPU cycles in error cases.
Checklist
CHANGELOG.mdfile describing and linking tothis PR