Skip to content

Conversation

@kwin
Copy link
Member

@kwin kwin commented Jan 16, 2026

with PUT

Directly transfer based on the PutTask's InputStream. Improve retry handling to not retry (some) BodyPublisher exceptions.

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@kwin kwin requested a review from cstamas January 16, 2026 17:36
assertEquals(0L, listener.getDataOffset());
assertEquals(6L, listener.getDataLength());
assertEquals(1, listener.getStartedCount());
assertTrue(listener.getStartedCount() > 0 && listener.getStartedCount() <= 2, "Started count: " + listener.getStartedCount());
Copy link
Member Author

Choose a reason for hiding this comment

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

There are some more tests which are strict with regard to started count. In general depending on the HTTP client it may be started multiple times (due to internal retries). Can we also relax the other assertions @cstamas?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure yet why they only fail with Java < 25...

Copy link
Member

Choose a reason for hiding this comment

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

That was the exact reason why it used tmp file, I wanted higher level APIs (ie listeners most importantly) protect from low level stuff, and make them behave in same way (re emitted events).

Copy link
Member Author

Choose a reason for hiding this comment

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

But that way you don't get real results, e.g. progress reported on the listener is not upload progress but copy progress to the temp file. I consider this worse than having different values for the started count. Not sure what the started count is used for potentially by consumers, but obviously retries may differ i.e. it is expected to have different numbers depending on the transport.

Copy link
Member Author

Choose a reason for hiding this comment

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

@cstamas Are you fine with relaxing the other ITs assertions with respect to num started counts?

@kwin kwin force-pushed the feature/jdk-transport-prevent-temp-file-for-put branch from 9dd1308 to 3ed3e8c Compare January 16, 2026 17:40
with PUT

Directly transfer based on the PutTask's InputStream.
Improve retry handling to not retry (some) BodyPublisher exceptions.
@kwin kwin force-pushed the feature/jdk-transport-prevent-temp-file-for-put branch from 3ed3e8c to 5b011e1 Compare January 18, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants