-
-
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
Make WorkerPools and Queues flushable #10001
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10001 +/- ##
==========================================
- Coverage 42.28% 42.27% -0.01%
==========================================
Files 616 616
Lines 80742 80742
==========================================
- Hits 34140 34132 -8
- Misses 42402 42409 +7
- Partials 4200 4201 +1
Continue to review full report at Codecov.
|
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.
I've just scratched the surface. I'l pick this up again tomorrow.
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.
ok ...
Adds Flush methods to Queues and the WorkerPool Further abstracts the WorkerPool Adds a final step to Flush the queues in the defer from PrintCurrentTest Fixes an issue with Settings inheritance in queues Signed-off-by: Andrew Thornton <art27@cantab.net>
62f51a2
to
b453c15
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.
I really appreciate all the comments you've added!
q.lock.Lock() | ||
if q.internal == nil { | ||
q.lock.Unlock() | ||
return fmt.Errorf("not ready to flush wrapped queue %s yet", q.Name()) |
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.
Should this really return an error? A hairy problem indeed.... 🤔
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.
the queue isn't flushed - so I think it should... This function isn't actually wired into anything though as wrapped queues don't actually implement Flushable - (they almost do).
I probably need to rethink this.
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.
Maybe it's OK to return an error under the following light: the admin wants to know that everything was processed, nothing is pending, but the worker is still initializing, so guess what? I don't know if anything is pending, hence I return an error.
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.
yeah that's the interpretation I mean.
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.
Great job! 🎉
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.
just looking throu
This is a partial breakout from #9856
Signed-off-by: Andrew Thornton art27@cantab.net