Conversation
Member
Author
|
I'm opening this PR to discuss the implementation and seek input. A few known issues:
|
Member
Author
|
I made a modification to mitigate known issue 2 above: it now will attempt to lock FIRST, only doing deadlock detection if that attempt fails. |
Member
|
should safe fail when mx ( |
Member
Author
|
@kares Indeed...it would likely just skip this code. This general pattern may be applicable elsewhere, so this should move into its own utility class. |
headius
force-pushed
the
require_deadlock
branch
from
August 22, 2016 17:30
0c53b64 to
2d6762e
Compare
Member
Author
|
Punting to 9.1.4.0. Too risky to stitch in at the last moment for 9.1.3.0. |
headius
force-pushed
the
require_deadlock
branch
from
September 30, 2016 03:57
2d6762e to
58cc903
Compare
Member
Author
|
Needs rebase and more thought. Bumping and rebasing. |
This detector works only with two threads, using the following heuristic: 1. If the lock is already acquired, obtain its owner thread. 2. Check if the owner thread is waiting on a lock. 3. If the lock the owner is waiting on is held by the current thread, raise an error. 4. If there's no owner and no deadlock, try to lock the thread for 500ms + rand(100)ms. 5. If the file has been locked, return success. 6. Otherwise, start over at 1. We may want a more advanced detector that can handle arbitrarily many threads, but it would be much heavier and require scanning all threads in the system, including those unrelated to the current program and those not actually trying to require files. See #3341.
headius
force-pushed
the
require_deadlock
branch
from
November 8, 2016 17:55
58cc903 to
a6e70e3
Compare
Member
Author
|
De-targeting. This may be useful some day but there's work required and many open questions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This detector works only with two threads, using the following
heuristic:
thread, raise an error.
500ms + rand(100)ms.
We may want a more advanced detector that can handle arbitrarily
many threads, but it would be much heavier and require scanning
all threads in the system, including those unrelated to the
current program and those not actually trying to require files.
See #3341.