GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Feat: config to close connection at end of tx by cstamas · Pull Request #1978 · apache/maven-resolver

Conversation

@cstamas

@cstamas cstamas commented Jul 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

New config option to make URL transport close connection at end of each transaction.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cstamas
Fix: the UrL test fails due connection leak detection
c9568ea
Fix this case, as URL transport, unlike other ones with
dedicated clients, does not control the connection pool.
@cstamas cstamas added this to the 2.0.21 milestone Jul 18, 2026
@cstamas
cstamas requested a review from kwin July 18, 2026 09:47
@cstamas cstamas self-assigned this Jul 18, 2026
@cstamas cstamas added the enhancement New feature or request label Jul 18, 2026
kwin
kwin reviewed Jul 18, 2026
View reviewed changes
Comment thread ...port-url/src/main/java/org/eclipse/aether/transport/url/UrlTransporterConfigurationKeys.java Outdated
* @configurationType {@link java.lang.Boolean}
* @configurationRepoIdSuffix Yes
*/
public static final String CONFIG_PROP_KEEP_ALIVE = CONFIG_PROPS_PREFIX + "keepAlive";

@kwin kwin Jul 18, 2026

Copy link
Copy Markdown
Member

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.

Not sure this option should be exposed. I don't really see a need for ever setting this flag.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@cstamas cstamas Jul 18, 2026

Copy link
Copy Markdown
Member Author

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.

I would argue about this. I saw all kind of broken MRMs in my life, but this was still an option to users, as we really do not check what kind of HTTP headers are they configuring, so they can easily add this header as well.

IMO, the fact this config would exist, would not mean no issue, and even may be handy in some cases.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ascheman ascheman mentioned this pull request Jul 18, 2026
RRF: self-heal from provably broken auto-discovered prefixes files #1976
Merged
@cstamas
Simplify; make it independent config, but document its dependency
840c47c
@cstamas
cstamas marked this pull request as ready for review July 18, 2026 10:19
@cstamas

cstamas commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

Will keep this config, and remove the UT hack so both can be now merged.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gnodet
gnodet reviewed Jul 18, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

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.

Good approach — adding a per-transport closeConnection config gives users a targeted escape hatch without the JVM-wide blast radius of -Dhttp.keepAlive=false. The implementation follows the existing config pattern precisely (ConfigUtils.getBoolean, repo-ID suffix, CONFIG_PROPS_PREFIX). Thread safety is airtight (private final, constructor-only).

One suggestion — the javadoc opening sentence has inverted polarity relative to the property name:

"Whether persistent connections should be used by this transport."

With closeConnection defaulting to false, a reader would interpret this as "persistent connections should NOT be used by default" — the opposite of actual behavior. The rest of the javadoc is accurate. Suggested rewording:

/**
 * Whether this transport should close the HTTP connection at the end of each transaction, effectively
 * disabling persistent connections (keep-alive). This configuration affects only this transport.
 * Important to note, that globally, on JVM-wide level persistent connections are controlled by
 * ...
 */

This aligns the javadoc polarity with the property name: "Whether ... should close the connection" → closeConnection = true/false.

Reviewed with oss-code-reviewer on behalf of @gnodet. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gnodet added a commit to gnodet/maven-resolver that referenced this pull request Jul 18, 2026
@gnodet
Run 54: reviewed apache#1977 and apache#1978
8d03e13
gnodet added a commit to gnodet/maven-resolver that referenced this pull request Jul 18, 2026
@gnodet
Run 54: reviewed apache#1977 and apache#1978
cf24d90
cstamas added 2 commits July 18, 2026 12:30
@cstamas
Apply PR comment and undo UT change
2d9eaf7
@cstamas
Merge remote-tracking branch 'upstream/master' into fix-url-test
b7538e4
@cstamas cstamas changed the title Fix: the UrL test fails due connection leak detection Feat: the UrL test fails due connection leak detection Jul 18, 2026
@cstamas cstamas changed the title Feat: the UrL test fails due connection leak detection Feat: config to close connection at end of tx Jul 18, 2026
@ascheman ascheman mentioned this pull request Jul 18, 2026
Do not check UrlTransporter for open connections after close #1977
Merged
8 tasks
@cstamas
cstamas requested review from gnodet and kwin July 18, 2026 10:38
gnodet
gnodet reviewed Jul 18, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

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.

Follow-up review (commits 3–4)

The javadoc on CONFIG_PROP_CLOSE_CONNECTION now accurately describes the property:

"Whether this transport should close the HTTP connection at the end of each transaction, effectively disabling persistent connections (keep-alive)."

This resolves the polarity issue flagged in the prior review — the description aligns correctly with the property name, default (false = keep-alive), and behavior. The added context about the JVM-wide http.keepAlive system property is a nice touch.

The UT hack removal (commit 3) is clean — with #1977 merged, the UrlTransporterTest connection leak check is properly skipped via the template method, so no test-side workaround is needed here.

CI: 19/20 matrix jobs pass; the one failure (macos-latest jdk-26-zulu 4.0.0-rc-5) is a transient Maven Central network timeout downloading io.grpc:grpc-context:1.78.0 — unrelated to this PR.

No remaining concerns — looks good to merge. 👍


Reviewed with oss-code-reviewer on behalf of @gnodet. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cstamas
cstamas merged commit 0feb214 into apache:master Jul 18, 2026
19 of 20 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@cstamas
cstamas deleted the fix-url-test branch July 18, 2026 10:44
@kwin

kwin commented Jul 18, 2026

Copy link
Copy Markdown
Member

@cstamas Shouldn't this rather be a transporter agnostic config then? One can already use this via aether.connector.http.headers though.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cstamas

cstamas commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

IMO this config is specific to transports that does not (or cannot) control their pool, and so far it is only the URL transport.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

1 similar comment
@cstamas

cstamas commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

IMO this config is specific to transports that does not (or cannot) control their pool, and so far it is only the URL transport.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@gnodet gnodet gnodet left review comments
@kwin kwin Awaiting requested review from kwin

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@cstamas cstamas

Labels

enhancement New feature or request

Projects

None yet

Milestone

2.0.21

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@cstamas @kwin @gnodet
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.