Skip to content

Fix panic during bind throttle#404

Open
venkatsridhar95 wants to merge 2 commits intopaypal:mainfrom
venkatsridhar95:fixPanic
Open

Fix panic during bind throttle#404
venkatsridhar95 wants to merge 2 commits intopaypal:mainfrom
venkatsridhar95:fixPanic

Conversation

@venkatsridhar95
Copy link
Copy Markdown
Collaborator

No description provided.

@@ -138,11 +138,12 @@ func bindEvictNameOk(bindName string) (bool) {
bind name and values */
func (mgr *adaptiveQueueManager) doBindEviction() (int) {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

@venkatsridhar95 venkatsridhar95 force-pushed the main branch 2 times, most recently from cd1c2cb to 7fd4baa Compare March 5, 2025 11:58
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