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: deadlock when stop keepalive bg task #941

Merged
merged 1 commit into from
May 29, 2023

Conversation

ShiKaiWi
Copy link
Member

Related Issues

Closes #

Detailed Changes

When shard lock is expired, the on_expired callback will be executed in the shard lock lease keepalive background task, and the callback will stop the background task and wait for its finish, leading to a deadlock. This change set fixes it by avoid waiting for the background task to finish.

Test Plan

Test it by these steps:

  • Start ceresmeta and ceresdb;
  • Wait all the shards to open on the ceresdb;
  • Stop ceresmeta to let the shard lock lease be expired;
  • Observe whether the shard lock can be revoked successfully.

@ShiKaiWi ShiKaiWi force-pushed the fix-dead-lock-when-exit-keepalive branch from 3f6e38d to 3523aa2 Compare May 29, 2023 07:51
Copy link
Contributor

@jiacai2050 jiacai2050 left a comment

Choose a reason for hiding this comment

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

LGTM

@jiacai2050 jiacai2050 merged commit efa166a into apache:main May 29, 2023
@ShiKaiWi ShiKaiWi deleted the fix-dead-lock-when-exit-keepalive branch May 29, 2023 09:09
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.

2 participants