Skip to content

Prevent joining detached thread in ThreadPoolImpl (#8635)#23

Open
limowang wants to merge 1 commit into
pegasus-kv:v6.6.4-pegasusfrom
limowang:v6.6.4-pegasus_local_partition_split
Open

Prevent joining detached thread in ThreadPoolImpl (#8635)#23
limowang wants to merge 1 commit into
pegasus-kv:v6.6.4-pegasusfrom
limowang:v6.6.4-pegasus_local_partition_split

Conversation

@limowang

Copy link
Copy Markdown

对应社区 commit:facebook@23ffed9

Summary:
This draining mechanism should not be run during JoinThreads() because it can detach threads that will be joined. Joining detached threads would throw an exception.

With this PR, we skip draining when JoinThreads() has already decided what threads to join(), so the threads will exit naturally once the work queue empties.

Pull Request resolved: facebook#8635

Test Plan: verified it unblocked using WaitForJobsAndJoinAllThreads() in facebook#8611.

Reviewed By: riversand963

Differential Revision: D30174587

Pulled By: ajkr

fbshipit-source-id: 144966398a607987e0763c7152a0f653fdbf3c8b

对应社区 commit:facebook@23ffed9

Summary:
This draining mechanism should not be run during `JoinThreads()` because it can detach threads that will be joined. Joining detached threads would throw an exception.

With this PR, we skip draining when `JoinThreads()` has already decided what threads to `join()`, so the threads will exit naturally once the work queue empties.

Pull Request resolved: facebook#8635

Test Plan: verified it unblocked using `WaitForJobsAndJoinAllThreads()` in facebook#8611.

Reviewed By: riversand963

Differential Revision: D30174587

Pulled By: ajkr

fbshipit-source-id: 144966398a607987e0763c7152a0f653fdbf3c8b
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.

1 participant