Conversation
Signed-off-by: Ian Kettle <25729118+icikle@users.noreply.github.com>
…riesEnumeration to be on the instance rather than the parent NestedJarFile. Signed-off-by: Ian Kettle <25729118+icikle@users.noreply.github.com>
…riesEnumeration to be on the instance rather than the parent NestedJarFile. Signed-off-by: Ian Kettle <25729118+icikle@users.noreply.github.com>
icikle
commented
Sep 16, 2026
| return new NestedJarEntry(this.zipContent.getEntry(this.cursor++)); | ||
| int nextValue; | ||
| ZipContent zipContent = ensureOpen(); | ||
| synchronized (this) { |
Owner
Author
There was a problem hiding this comment.
synchronizing on the JarEntriesEnumeration rather than the NestedJarFile instance. Means that 2 JarEntriesEnumeration instances won't contest for the same lock. Moving the zipContent.getEntry out of the synchronized block appears safe. I would investigate more before saying is definetly safe.
icikle
commented
Sep 16, 2026
| long writeStamp = 0; | ||
| try { | ||
| // any smaller and the scheduler and the parking wouldn't be useful and recursion too immediate. | ||
| writeStamp = this.lock.tryWriteLock(2, TimeUnit.MILLISECONDS); |
Owner
Author
There was a problem hiding this comment.
Tries to get a write lock and if not obtained in 2ms it recurses back to try the optimistic read again. Would want additional saftey on the recursion to ensure it can't result in a stack overflow.
Owner
Author
|
This is a dump from the proof app running with this branches changes. |
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 PR is looking at how to extend spring-projects#51580 so that the proof app starts up without locking up. Note that spring-projects#51580 already eliminates the hasEntry as a place where the threads get blocked. With that change though the locking hit further into the FileDataBlock or NestedJarFile. This branch does 2 things to minimise this blocking.
My other idea reducing contention in the FileDataBlock.FileAccess is more involved and possibly overkill if contention is rare.
Note - ignore the issue number in the branch name - it has a typo in it