-
Notifications
You must be signed in to change notification settings - Fork 136
[MRESOLVER-302] Introduce onSessionClose #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
And make it use in new HTTP/2 transports. --- https://issues.apache.org/jira/browse/MRESOLVER-302
maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java
Outdated
Show resolved
Hide resolved
maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java
Show resolved
Hide resolved
* | ||
* @since TBD | ||
*/ | ||
interface CloseableRepositorySystemSession extends RepositorySystemSession, Closeable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not making the RepositorySystemSession
always implement Closeable
with an empty default method close()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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,
maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java
Outdated
Show resolved
Hide resolved
...er-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemLifecycle.java
Show resolved
Hide resolved
...lver-transport-jdk-11/src/main/java/org/eclipse/aether/transport/jdk/JdkHttpTransporter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Resolve #974 |
Resolve #974 |
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