Visitar URL original
[1.9.x] Prune FileLockNamedLock thread entries that hold no step by slachiewicz · Pull Request #2303 · apache/maven-resolver · GitHub
Skip to content

[1.9.x] Prune FileLockNamedLock thread entries that hold no step - #2303

Open
slachiewicz wants to merge 1 commit into
apache:maven-resolver-1.9.xfrom
slachiewicz:filelock-thread-steps-prune-19x
Open

slachiewicz wants to merge 1 commit into
apache:maven-resolver-1.9.xfrom
slachiewicz:filelock-thread-steps-prune-19x

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

FileLockNamedLock.threadSteps kept an entry for every thread that ever used the lock, including threads whose attempt timed out, so it retained Thread objects for the lock's lifetime. Entries are now removed when a thread's step stack empties or its attempt fails. Same change as the FileLockNamedLock part of #2300 on master.

threadSteps kept an entry for every thread that ever used the lock, including
threads whose attempt timed out, for the lock's lifetime.
@slachiewicz slachiewicz added bug Something isn't working resolver1 labels Nov 8, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 8, 2026 22:39

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Correct thread-entry cleanup for FileLockNamedLock. Synchronization is sound — forgetThreadWithoutSteps() acquires the same criticalRegion lock guarding all threadSteps access, and only the owning thread ever modifies its own entry, so no race is possible. The doUnlock removal-before-check reordering is semantically equivalent to the old code because anyOtherThreadHasSteps() already excluded the current thread.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

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

Labels

bug Something isn't working resolver1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants