-
-
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
Fix panic in unique persistable channel queue #16072
Conversation
There is an incorrect casting in the wrapped queue. Fix go-gitea#16071 Signed-off-by: Andrew Thornton <[email protected]>
@@ -188,7 +188,7 @@ func (q *PersistableChannelUniqueQueue) Run(atShutdown, atTerminate func(func()) | |||
go q.internal.Run(func(_ func()) {}, func(_ func()) {}) | |||
go func() { | |||
_ = q.internal.Flush(0) | |||
log.Debug("LevelUniqueQueue: %s flushed so shutting down", q.internal.(*LevelQueue).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.
I want to know if line 197 also may panic?
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.
nope it can't
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.
But it also q.internal.(*LevelUniqueQueue)
when luq, ok := q.internal.(*LevelUniqueQueue); !ok
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.
it's only assigned to LevelUniqueQueue.
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.
so maybe if q.internal.(*LevelUniqueQueue).ByteFIFOUniqueQueue.byteFIFO.Len(luq.shutdownCtx) != 0
will not make confusion.
Codecov Report
@@ Coverage Diff @@
## main #16072 +/- ##
=======================================
Coverage 44.08% 44.08%
=======================================
Files 683 683
Lines 82442 82442
=======================================
+ Hits 36341 36344 +3
+ Misses 40187 40182 -5
- Partials 5914 5916 +2
Continue to review full report at Codecov.
|
look's like a copy paste issue ;) |
There is an incorrect casting in the wrapped queue. Fix go-gitea#16071 Signed-off-by: Andrew Thornton <[email protected]>
There is an incorrect casting in the wrapped queue.
Fix #16071
Signed-off-by: Andrew Thornton [email protected]