-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fixes #11282 - Deadlocks with DEBUG logging enabled in jetty-server testing. #11306
Conversation
…esting. Introduced AutoLock.tryLock() to use it in the toString() implementations that lock in order to retrieve a consistent state to produce the string. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
The PR build failed with a timeout in the forked process. We need to investigate to figure out if this was a fluke or if this change introduces a bug we've overlooked. |
The JDK21 build here failed with a timeout https://jenkins.webtide.net/blue/organizations/jenkins/jetty.project/detail/PR-11306/1/pipeline |
* <p>Tries to acquire the lock.</p> | ||
* <p>Whether the lock was acquired can be tested | ||
* with {@link #isHeldByCurrentThread()}.</p> | ||
* <p>Typical usage of this method is in {@code toString()}, | ||
* to avoid deadlocks when the implementation needs to lock | ||
* to retrieve a consistent state to produce the string.</p> | ||
* | ||
* @return this AutoLock for unlocking | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* <p>Tries to acquire the lock.</p> | |
* <p>Whether the lock was acquired can be tested | |
* with {@link #isHeldByCurrentThread()}.</p> | |
* <p>Typical usage of this method is in {@code toString()}, | |
* to avoid deadlocks when the implementation needs to lock | |
* to retrieve a consistent state to produce the string.</p> | |
* | |
* @return this AutoLock for unlocking | |
*/ | |
* <p>Tries to acquire the lock.</p> | |
* <p>Whether the lock was acquired can be tested | |
* with {@link #isHeldByCurrentThread()}.</p> | |
* <p>Typical usage of this method is in {@code toString()}, | |
* to avoid deadlocks when the implementation needs to lock | |
* to retrieve a consistent state to produce the string.</p> | |
* @see ReentrantLock#isHeldByCurrentThread() | |
* @return this AutoLock for unlocking | |
*/ |
Introduced AutoLock.tryLock() to use it in the toString() implementations that lock in order to retrieve a consistent state to produce the string.