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

client: explicit stop LeaseExecutor in FileInstance::UnInitialize #368

Merged
merged 1 commit into from
Jun 28, 2021

Conversation

wu-hanqing
Copy link
Contributor

What problem does this PR solve?

Problem Summary:

When uninit FileClient and some files are not closed, in FileInstance's destructor it will destroy LeaseExecutor, but LeaseExecutor's destructor will wait for backend lease task to stop, so without explicit close a file, thread will be stuck here.

What is changed and how it works?

What's Changed:

Explicit call LeaseExecutor::Stop in FileInstance::UnInitialize

Side effects(Breaking backward compatibility? Performance regression?):

No

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@wu-hanqing wu-hanqing force-pushed the fix/leaseexecutor branch 2 times, most recently from 589c56d to 5edc463 Compare May 25, 2021 11:02

std::this_thread::sleep_for(std::chrono::seconds(10));

// does not explicit call exec.Stop()
Copy link
Contributor

Choose a reason for hiding this comment

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

delete

Copy link
Contributor Author

Choose a reason for hiding this comment

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

annotations here are used for explanation

@wu-hanqing
Copy link
Contributor Author

recheck

1 similar comment
@wu-hanqing
Copy link
Contributor Author

recheck

When uninit FileClient and some files are not closed, in
FileInstance's destructor it will destroy LeaseExecutor, but
LeaseExecutor's destructor will wait for backend lease task to stop,
so without explicit close a file, thread will be stuck here.

Signed-off-by: wuhanqing <wuhanqing@hotmail.com>
@wu-hanqing
Copy link
Contributor Author

recheck

@ilixiaocui ilixiaocui merged commit 5335371 into opencurve:master Jun 28, 2021
@wu-hanqing wu-hanqing deleted the fix/leaseexecutor branch January 12, 2022 08:23
ilixiaocui pushed a commit to ilixiaocui/curve that referenced this pull request Feb 6, 2023
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