[MRESOLVER-302] Introduce onSessionClose#357
Merged
cstamas merged 15 commits intoapache:masterfrom Nov 9, 2023
Merged
Conversation
And make it use in new HTTP/2 transports. --- https://issues.apache.org/jira/browse/MRESOLVER-302
kwin
reviewed
Nov 8, 2023
| * | ||
| * @since TBD | ||
| */ | ||
| interface CloseableRepositorySystemSession extends RepositorySystemSession, Closeable { |
Member
There was a problem hiding this comment.
why not making the RepositorySystemSession always implement Closeable with an empty default method close()
Member
Author
There was a problem hiding this comment.
because that will suddenly emit warning in all the existing code (think Mojos) that "using closeable reasource without try-with-resource" or alike. Closing session is really objective of "resolver managing" client code (like Maven), but "resolver using (but not managing it)" client code (like Maven Mojos) should really not be annoyed is session closeable or not, they should NEVER close it anyway,
gnodet
reviewed
Nov 8, 2023
olamy
approved these changes
Nov 9, 2023
|
Resolve #974 |
|
Resolve #974 |
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.
And make it used in new HTTP/2 transports.
Note about implementation:
In short, the Resolver 1.x session handling is still present, but is deprecated (DefaultRepositorySystemSession default ctor) and will emit warnings if application integrating Resolver 2.x still uses Resolver 1.x session handling and is about to use new Resolver 2.x features (like HTTP/2 transport) that require onSessionClose. Doing that will produce leaks, unless they are one-time CLI apps.
https://issues.apache.org/jira/browse/MRESOLVER-302