Skip to content
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

8155902: DataOuputStream should clarify that it might write primitive types as multiple byte groups #14791

Closed
wants to merge 4 commits into from

Conversation

bplb
Copy link
Member

@bplb bplb commented Jul 6, 2023

Add a disclaimer to java.io.DataOutputStream to the effect that it makes no guarantee as to how the underlying output stream actually writes the bytes provided to it.


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-8311882 to be approved

Issues

  • JDK-8155902: DataOuputStream should clarify that it might write primitive types as multiple byte groups (Bug - P4)
  • JDK-8311882: DataOuputStream should clarify that it might write primitive types as multiple byte groups (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14791

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

Using diff file

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

Webrev

Link to Webrev Comment

@bplb
Copy link
Member Author

bplb commented Jul 6, 2023

It might be equally reasonable simply to resolve the issue as "Not an Issue." A CSR will be created if that is not the case.

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 6, 2023

👋 Welcome back bpb! 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 openjdk bot added the rfr Pull request is ready for review label Jul 6, 2023
@openjdk
Copy link

openjdk bot commented Jul 6, 2023

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

  • core-libs

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 the core-libs core-libs-dev@openjdk.org label Jul 6, 2023
@mlbridge
Copy link

mlbridge bot commented Jul 6, 2023

Webrevs

@djelinski
Copy link
Member

This issue is reported against JDK 8 and 9. It was fixed in 16 with 17f04fc. I think you can close it as duplicate.

@bplb
Copy link
Member Author

bplb commented Jul 7, 2023

This issue is reported against JDK 8 and 9. It was fixed in 16 with 17f04fc. I think you can close it as duplicate.

Thanks. I saw that change go by but did not connect the dots. Was it actually verified that things are not split up into two or more packets? It seems that write(2) could in fact return a value less than the number of bytes requested.

@djelinski
Copy link
Member

Was it actually verified that things are not split up into two or more packets? It seems that write(2) could in fact return a value less than the number of bytes requested.

Yes, the test case included in JBS sends all 4 bytes in a single packet now.
We can't guarantee that every writeInt will always send all bytes in the same packet, but at least we won't send single-byte packets.

@bplb
Copy link
Member Author

bplb commented Jul 8, 2023

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jul 8, 2023
@openjdk
Copy link

openjdk bot commented Jul 8, 2023

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

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

@AlanBateman
Copy link
Contributor

In passing, we should probably look into the inconsistency in the synchronization. The write methods are synchronized, the writeXXX methods and other methods are not. The class specified that it is not safe for use by concurrent threads without appropriate synchronization.

@bplb
Copy link
Member Author

bplb commented Jul 11, 2023

In passing, we should probably look into the inconsistency in the synchronization.

This can be addressed in the context of JDK-8295797.

@bplb bplb changed the title 8155902: DataOutputStream writeInt creates 2 packets instead of 1 8155902: DataOuputStream should clarify that it might write primitive types as multiple byte groups Jul 11, 2023
Copy link
Member

@djelinski djelinski 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
Copy link

openjdk bot commented Jul 12, 2023

@bplb 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:

8155902: DataOuputStream should clarify that it might write primitive types as multiple byte groups

Reviewed-by: alanb, djelinski, lancea, rriggs

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 51 new commits pushed to the master branch:

  • f82c818: 8308694: Clarify reversed() default methods' implementation requirements
  • 7304316: 8311926: java/lang/ScopedValue/StressStackOverflow.java takes 9mins in tier1
  • aa7367f: 8311921: Inform about MaxExpectedDataSegmentSize in case of pthread_create failures on AIX
  • 753bd56: 8311870: Split CompressedKlassPointers from compressedOops.hpp
  • 0b0e064: 8311656: Shenandoah: Unused ShenandoahSATBAndRemarkThreadsClosure::_claim_token
  • fd7fddb: 8295894: Remove SECOM certificate that is expiring in September 2023
  • d82ade3: 8310683: Refactor StandardCharset/standard.java to use JUnit
  • aac903d: 8311805: Clean up ScrollPane: drop redundant initialiser, mark scroller final
  • 15195e6: 8310066: Improve test coverage for JVMTI GetThreadState on carrier and mounted vthread
  • 6cb9ec3: 6960866: [Fmt-Ch] ChoiceFormat claims impossible and unimplemented functionality
  • ... and 41 more: https://git.openjdk.org/jdk/compare/6ebb0e3bd4ba3579c66cdc5a329e95df7bda5b95...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Jul 12, 2023
@bplb
Copy link
Member Author

bplb commented Jul 12, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Jul 12, 2023

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

  • f82c818: 8308694: Clarify reversed() default methods' implementation requirements
  • 7304316: 8311926: java/lang/ScopedValue/StressStackOverflow.java takes 9mins in tier1
  • aa7367f: 8311921: Inform about MaxExpectedDataSegmentSize in case of pthread_create failures on AIX
  • 753bd56: 8311870: Split CompressedKlassPointers from compressedOops.hpp
  • 0b0e064: 8311656: Shenandoah: Unused ShenandoahSATBAndRemarkThreadsClosure::_claim_token
  • fd7fddb: 8295894: Remove SECOM certificate that is expiring in September 2023
  • d82ade3: 8310683: Refactor StandardCharset/standard.java to use JUnit
  • aac903d: 8311805: Clean up ScrollPane: drop redundant initialiser, mark scroller final
  • 15195e6: 8310066: Improve test coverage for JVMTI GetThreadState on carrier and mounted vthread
  • 6cb9ec3: 6960866: [Fmt-Ch] ChoiceFormat claims impossible and unimplemented functionality
  • ... and 41 more: https://git.openjdk.org/jdk/compare/6ebb0e3bd4ba3579c66cdc5a329e95df7bda5b95...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 12, 2023
@openjdk openjdk bot closed this Jul 12, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 12, 2023
@openjdk
Copy link

openjdk bot commented Jul 12, 2023

@bplb Pushed as commit ed9337e.

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

@bplb bplb deleted the DataOutputStream-writeInt-8155902 branch July 14, 2023 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants