Skip to content

8350279: HttpClient: Add a new HttpResponse method to identify connections#24154

Closed
vy wants to merge 26 commits intoopenjdk:masterfrom
vy:connLabel2
Closed

8350279: HttpClient: Add a new HttpResponse method to identify connections#24154
vy wants to merge 26 commits intoopenjdk:masterfrom
vy:connLabel2

Conversation

@vy
Copy link
Contributor

@vy vy commented Mar 21, 2025

Adds HttpResponse::connectionLabel method that provides an identifier for the connection.

Implementation note: The feature is facilitated by HttpConnection::label, which should not be confused with HttpConnection::id. This distinction is explained in the JavaDoc of both properties.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8352751 to be approved

Issues

  • JDK-8350279: HttpClient: Add a new HttpResponse method to identify connections (Enhancement - P4)
  • JDK-8352751: HttpClient: Add a new HttpResponse method to identify connections (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24154/head:pull/24154
$ git checkout pull/24154

Update a local copy of the PR:
$ git checkout pull/24154
$ git pull https://git.openjdk.org/jdk.git pull/24154/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24154

View PR using the GUI difftool:
$ git pr show -t 24154

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24154.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 21, 2025

👋 Welcome back vyazici! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Mar 21, 2025

@vy This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8350279: HttpClient: Add a new HttpResponse method to identify connections

Reviewed-by: dfuchs, jpai

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 407 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dfuch, @jaikiran) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk
Copy link

openjdk bot commented Mar 21, 2025

@vy The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added net net-dev@openjdk.org rfr Pull request is ready for review labels Mar 21, 2025
@mlbridge
Copy link

mlbridge bot commented Mar 21, 2025

@dfuch
Copy link
Member

dfuch commented Mar 21, 2025

/csr required

@openjdk
Copy link

openjdk bot commented Mar 21, 2025

@dfuch usage: /csr [needed|unneeded], requires that the issue the pull request refers to links to an approved CSR request.

@liach
Copy link
Member

liach commented Mar 23, 2025

This new API returns an Optional.

  1. Can users make any assumption about the connection identity when it is empty? Such as assuming such connections are all the same (as implied by your use of orElse(null) in tests) or all different?
  2. If we cannot make any assumption about the empty return value, can users make any assumption that a HttpResponse obtained from the JDK built-in HttpClient always return non-empty for the label?

vy and others added 3 commits March 24, 2025 11:09
…nectionLabel`

Co-authored-by: Daniel Fuchs <67001856+dfuch@users.noreply.github.com>
@vy
Copy link
Contributor Author

vy commented Mar 24, 2025

/csr needed

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Mar 24, 2025
@openjdk
Copy link

openjdk bot commented Mar 24, 2025

@vy has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@vy please create a CSR request for issue JDK-8350279 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@dfuch
Copy link
Member

dfuch commented Mar 24, 2025

  • Can users make any assumption about the connection identity when it is empty? Such as assuming such connections are all the same (as implied by your use of orElse(null) in tests) or all different?

No. If empty is returned you can make no assumptions. In practice this should never be null with our impl (except possibly in whitebox tests)

  • If we cannot make any assumption about the empty return value, can users make any assumption that a HttpResponse obtained from the JDK built-in HttpClient always return non-empty for the label?

Yes.

@liach
Copy link
Member

liach commented Mar 24, 2025

If we cannot make any assumption about the empty return value, can users make any assumption that a HttpResponse obtained from the JDK built-in HttpClient always return non-empty for the label?
Yes.

Should we specify this, like "The JDK built-in implementation of the {@code HttpClient} always assign a label to connections it create"?

@dfuch
Copy link
Member

dfuch commented Mar 24, 2025

Should we specify this, like "The JDK built-in implementation of the {@code HttpClient} always assign a label to connections it create"?

Good question - that would be an @implNote - but I'm not sure this is required. The caller can determine whether a connection label is provided by testing whether the optional is empty.

Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have anything else. This looks good to me. Thank you for working on this enhancement and your patience during the review.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Apr 9, 2025
@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Apr 10, 2025
Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 15, 2025
@vy
Copy link
Contributor Author

vy commented Apr 15, 2025

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 15, 2025
@openjdk
Copy link

openjdk bot commented Apr 15, 2025

@vy
Your change (at version ad73d38) is now ready to be sponsored by a Committer.

@jaikiran
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 15, 2025

Going to push as commit 5fc18f5.
Since your change was applied there have been 407 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 15, 2025
@openjdk openjdk bot closed this Apr 15, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Apr 15, 2025
@openjdk
Copy link

openjdk bot commented Apr 15, 2025

@jaikiran @vy Pushed as commit 5fc18f5.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@vy vy deleted the connLabel2 branch May 12, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated net net-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

5 participants