-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Only attempt to flush queue if the underlying worker pool is not finished #18593
Merged
Conversation
This file contains 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
…shed There is a possible race whereby a worker pool could be cancelled but yet the underlying queue is not empty. This will lead to flush-all cycling because it cannot empty the pool. Signed-off-by: Andrew Thornton <[email protected]>
zeripath
added a commit
to zeripath/gitea
that referenced
this pull request
Feb 5, 2022
…shed (go-gitea#18593) Backport go-gitea#18593 There is a possible race whereby a worker pool could be cancelled but yet the underlying queue is not empty. This will lead to flush-all cycling because it cannot empty the pool. * On shutdown of Persistant Channel Queues close datachan and empty Partial Backport go-gitea#18415 Although we attempt to empty the datachan in queues - due to races we are better off just closing the channel and forcibly emptying it in shutdown. Fix go-gitea#18618 Signed-off-by: Andrew Thornton <[email protected]>
Gusted
reviewed
Feb 5, 2022
GiteaBot
added
the
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
label
Feb 5, 2022
Codecov Report
@@ Coverage Diff @@
## main #18593 +/- ##
=======================================
Coverage ? 46.29%
=======================================
Files ? 846
Lines ? 121201
Branches ? 0
=======================================
Hits ? 56106
Misses ? 58288
Partials ? 6807
Continue to review full report at Codecov.
|
Co-authored-by: Gusted <[email protected]>
lunny
pushed a commit
that referenced
this pull request
Feb 6, 2022
…shed (#18593) (#18620) * Only attempt to flush queue if the underlying worker pool is not finished (#18593) Backport #18593 There is a possible race whereby a worker pool could be cancelled but yet the underlying queue is not empty. This will lead to flush-all cycling because it cannot empty the pool. * On shutdown of Persistant Channel Queues close datachan and empty Partial Backport #18415 Although we attempt to empty the datachan in queues - due to races we are better off just closing the channel and forcibly emptying it in shutdown. Fix #18618 Signed-off-by: Andrew Thornton <[email protected]> * Move zero workers warning to debug Fix #18617 Signed-off-by: Andrew Thornton <[email protected]> * Update modules/queue/manager.go Co-authored-by: Gusted <[email protected]> * Update modules/queue/manager.go Co-authored-by: Gusted <[email protected]> Co-authored-by: Gusted <[email protected]>
Chianina
pushed a commit
to Chianina/gitea
that referenced
this pull request
Mar 28, 2022
…shed (go-gitea#18593) * Only attempt to flush queue if the underlying worker pool is not finished There is a possible race whereby a worker pool could be cancelled but yet the underlying queue is not empty. This will lead to flush-all cycling because it cannot empty the pool. Signed-off-by: Andrew Thornton <[email protected]> * Apply suggestions from code review Co-authored-by: Gusted <[email protected]> Co-authored-by: Gusted <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
backport/done
All backports for this PR have been created
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
type/bug
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.
There is a possible race whereby a worker pool could be cancelled but yet the
underlying queue is not empty. This will lead to flush-all cycling because it
cannot empty the pool.
The solution here is to add another function to the managed pools which will allow testing if the managed pool has been finished before attempting to flush.
Signed-off-by: Andrew Thornton [email protected]