slachiewicz commented on issue #1992:
URL: 
https://github.com/apache/maven-resolver/issues/1992#issuecomment-5499273671

   ### Analysis & Triage
   - **Problem Identified**: In `DefaultArtifactResolver` and 
`DefaultMetadataResolver`, `shared` and `exclusive` `SyncContext` instances are 
managed in an outer `try-with-resources` block, while `resolve()` also 
explicitly calls `current.close()` internally and in a `finally` block, causing 
duplicate `.close()` invocations on the same context instance.
   - **Affected Versions**: Both **1.9.x** and **2.0.x / master**.
   - **Plan to Fix**: 
     1. Refactor lock transition in `DefaultArtifactResolver` and 
`DefaultMetadataResolver` so `SyncContext` instances are closed strictly once 
via the outer try-with-resources.
     2. Add a unit test verifying single-close execution per `SyncContext` 
instance.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to