Skip to content

8386085: Livelock in AbstractQueuedSyncronizer.cleanQueue() when multiple threads do tryAcquire() with a short timeout and no permits available#4529

Open
kirill-shirokov wants to merge 2 commits into
openjdk:masterfrom
kirill-shirokov:8386085-backport
Open

8386085: Livelock in AbstractQueuedSyncronizer.cleanQueue() when multiple threads do tryAcquire() with a short timeout and no permits available#4529
kirill-shirokov wants to merge 2 commits into
openjdk:masterfrom
kirill-shirokov:8386085-backport

Conversation

@kirill-shirokov

@kirill-shirokov kirill-shirokov commented Jun 18, 2026

Copy link
Copy Markdown
Member

Please note that it cannot be a clean fix, because the tests were fixed for JDK 17 where ExecutorService does not yet implement AutoCloseable. The additional fix (comparing to the clean one) is made as a separate commit

Testing done:



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8386085 needs maintainer approval

Issue

  • JDK-8386085: Livelock in AbstractQueuedSyncronizer.cleanQueue() when multiple threads do tryAcquire() with a short timeout and no permits available (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/4529/head:pull/4529
$ git checkout pull/4529

Update a local copy of the PR:
$ git checkout pull/4529
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/4529/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4529

View PR using the GUI difftool:
$ git pr show -t 4529

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/4529.diff

Using Webrev

Link to Webrev Comment

…iple threads do tryAcquire() with a short timeout and no permits available

Reviewed-by: dl, alanb
@bridgekeeper

bridgekeeper Bot commented Jun 18, 2026

Copy link
Copy Markdown

👋 Welcome back kshiroko! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jun 18, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot changed the title backport 7644d4afd437b64674a86012ab65dd0c9861cafe 8386085: Livelock in AbstractQueuedSyncronizer.cleanQueue() when multiple threads do tryAcquire() with a short timeout and no permits available Jun 18, 2026
@openjdk

openjdk Bot commented Jun 18, 2026

Copy link
Copy Markdown

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk Bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Jun 18, 2026
@openjdk

openjdk Bot commented Jun 18, 2026

Copy link
Copy Markdown

⚠️ @kirill-shirokov This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 18, 2026
@mlbridge

mlbridge Bot commented Jun 18, 2026

Copy link
Copy Markdown

Webrevs

@openjdk openjdk Bot removed the clean Identical backport; no merge resolution required label Jun 19, 2026

@phohensee phohensee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not an expert on this, but doesn't AutoClosable imply you need a finally block on your try?

@kirill-shirokov

kirill-shirokov commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

Not an expert on this, but doesn't AutoClosable imply you need a finally block on your try?

With AutoCloseable you don't have to specify finally { resource.close(); } block -- it is done automagically.
Without AC (like in this PR) you have to provide your own finally block, which was done here:

@phohensee phohensee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see it now. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants