-
Notifications
You must be signed in to change notification settings - Fork 84
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 during bind throttle #404
base: main
Are you sure you want to change the base?
Conversation
@@ -138,11 +138,12 @@ func bindEvictNameOk(bindName string) (bool) { | |||
bind name and values */ | |||
func (mgr *adaptiveQueueManager) doBindEviction() (int) { |
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 outer lock on bindevict is being held for too long. It gets unlocked only after inner lock on workerpool is done processing dispatched workers.
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.
Though it is on copy. It is safe reduce scope of the lock
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 change looks good.
} | ||
} | ||
|
||
func (bindEvict *BindEvict) updateThrottle(entry *BindThrottle) { |
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.
This function needs to be used with caution (hold the lock when updating the copy), the new struct has a different lock.
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.
Can we change decrease logic also to avoid slow recovery?
@@ -138,11 +138,12 @@ func bindEvictNameOk(bindName string) (bool) { | |||
bind name and values */ | |||
func (mgr *adaptiveQueueManager) doBindEviction() (int) { |
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.
Though it is on copy. It is safe reduce scope of the lock
} | ||
} | ||
|
||
func (bindEvict *BindEvict) updateThrottle(entry *BindThrottle) { |
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.
Can we change decrease logic also to avoid slow recovery?
No description provided.