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

Resolve potential deadlock state during EsThreadPoolExecutor shutdown #4444

Merged
merged 1 commit into from Dec 15, 2013

Conversation

imotov
Copy link
Contributor

@imotov imotov commented Dec 14, 2013

Fixes #4334

The deadlock occurs between monitor object of EsThreadPoolExecutor and mainLock of ThreadPoolExecutor. The shutdown method of EsThreadPoolExecutor obtains the lock on monitor first and waits for mainLock of ThreadPoolExecutor in ThreadPoolExecutor#shutdown for part of the processing, while EsThreadPoolExecutor#terminated is executed under mainLock and tries to obtain monitor to notify listeners.

@kimchy
Copy link
Member

kimchy commented Dec 14, 2013

LGTM, nice catch

@s1monw
Copy link
Contributor

s1monw commented Dec 14, 2013

+1

Fixes elastic#4334

The deadlock occurs between monitor object of EsThreadPoolExecutor and mainLock of ThreadPoolExecutor. The shutdown method of EsThreadPoolExecutor obtains the lock on monitor first and waits for mainLock of ThreadPoolExecutor in ThreadPoolExecutor#shutdown for part of the processing, while EsThreadPoolExecutor#terminated is executed under mainLock and tries to obtain monitor to notify listeners.
@imotov imotov merged commit d8ba92c into elastic:master Dec 15, 2013
@imotov imotov deleted the issue-4334-deadlock-on-shutdown branch May 1, 2020 22:19
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.

Node deadlock on shutdown
3 participants