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 user queue in scheduler that was not thread-safe #6077

Merged
merged 5 commits into from
Jul 20, 2024

Conversation

justinjung04
Copy link
Contributor

@justinjung04 justinjung04 commented Jul 10, 2024

What this PR does:

Which issue(s) this PR fixes:
Fixes an issue where user queue in scheduler wasn't thread-safe

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Justin Jung <jungjust@amazon.com>
@justinjung04 justinjung04 changed the title Fix concurrency bug in scheduler Fix user queue in scheduler that was not thread-safe Jul 10, 2024
Signed-off-by: Justin Jung <jungjust@amazon.com>
@justinjung04 justinjung04 force-pushed the scheduler-bugfix branch 2 times, most recently from 9eaf463 to 50ea14a Compare July 10, 2024 22:45
Signed-off-by: Justin Jung <jungjust@amazon.com>
@justinjung04 justinjung04 marked this pull request as ready for review July 10, 2024 23:50
Copy link
Contributor

@harry671003 harry671003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks Justin.

Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, yes, there is a data race there. And I believe your proposed fix and test for the race are appropriate. I have only nits on covering all the changes with the test

pkg/scheduler/queue/user_queues.go Show resolved Hide resolved
pkg/scheduler/queue/user_queues.go Show resolved Hide resolved
Signed-off-by: Justin Jung <jungjust@amazon.com>
@justinjung04 justinjung04 requested a review from friedrichg July 15, 2024 16:44
Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

Signed-off-by: Daniel Blando <daniel@blando.com.br>
@danielblando danielblando merged commit 0edfd7d into cortexproject:master Jul 20, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants