Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

venkatsridhar95
Copy link
Collaborator

No description provided.

@@ -138,11 +138,12 @@ func bindEvictNameOk(bindName string) (bool) {
bind name and values */
func (mgr *adaptiveQueueManager) doBindEviction() (int) {
Copy link
Collaborator

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.

Copy link
Collaborator

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

Copy link
Collaborator

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) {
Copy link
Collaborator

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.

Copy link
Collaborator

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) {
Copy link
Collaborator

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) {
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants