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

6924219: (fc spec) FileChannel.write(ByteBuffer, position) behavior when file opened for append not specified #10707

Closed
wants to merge 2 commits into from

Conversation

bplb
Copy link
Member

@bplb bplb commented Oct 13, 2022

Add some verbiage stating that the outcome of invoking the absolute write method java.nio.channels.write(ByteBuffer,long) is unspecified when the channel was opened with the APPEND option present.


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 a CSR request to be approved

Issues

  • JDK-6924219: (fc spec) FileChannel.write(ByteBuffer, position) behavior when file opened for append not specified
  • JDK-8295312: (fc spec) FileChannel.write(ByteBuffer, position) behavior when file opened for append not specified (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10707

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 13, 2022

👋 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 Oct 13, 2022
@openjdk
Copy link

openjdk bot commented Oct 13, 2022

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

  • nio

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 nio nio-dev@openjdk.org label Oct 13, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 13, 2022

Webrevs

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Oct 13, 2022
* therefore unspecified.
* therefore unspecified. In this mode an invocation of the {@linkplain
* #write(ByteBuffer,long) absolute write} operation leads to unspecified
* behavior.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about the phrase "absolute write" as we haven't used that before. I think it might be better to say something like "In this mode, the behavior of the method to write at a given position is also system-dependent".

Copy link
Member Author

Choose a reason for hiding this comment

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

I was keying off the expression "In this mode each invocation of a relative write operation" earlier in the same paragraph and also in analogy to absolute and relative operations in Buffer. That said, I don't disagree with the comment.

@AlanBateman
Copy link
Contributor

If something has a file opened for append then it's a bug to attempt to write and specify a position. It would be possible to detect this, throw an exception, and thus avoid bugs. However it would be a behavior change. The conservative approach is to specify that it leads to unspecified behavior as you have done.

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Oct 18, 2022
@openjdk
Copy link

openjdk bot commented Oct 18, 2022

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

6924219: (fc spec) FileChannel.write(ByteBuffer, position) behavior when file opened for append not specified

Reviewed-by: alanb

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

  • 21a825e: 8288387: GetLocalXXX/SetLocalXXX spec should require suspending target thread
  • 8d751de: 8295231: Move all linking of native libraries to make
  • f300ec8: 8294546: document where javac differs when invoked via launcher and ToolProvider
  • b269c51: 8295395: Linux Alpha Zero builds fail after JDK-8292591
  • ae60599: 8295023: Interpreter(AArch64): Implement -XX:+PrintBytecodeHistogram and -XX:+PrintBytecodePairHistogram options
  • 4d37ef2: 8295262: Build binutils out of source tree
  • 0919a3a: 8294186: AArch64: VectorMaskToLong failed on SVE2 machine with -XX:UseSVE=1
  • ec2981b: 8293711: Factor out size parsing functions from arguments.cpp
  • 5d273b9: 8295278: Add parallel class loading tests
  • 172006c: 8295333: G1: Remove unnecessary check in G1Policy::calculate_desired_eden_length_by_mmu
  • ... and 30 more: https://git.openjdk.org/jdk/compare/fdb74ed45240477bd08eb40ede5eaa2345ca6b5d...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 the ready Pull request is ready to be integrated label Oct 18, 2022
@bplb
Copy link
Member Author

bplb commented Oct 18, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Oct 18, 2022

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

  • 5dbd495: 8295457: Make the signatures of write barrier methods consistent
  • 7b2e83b: 8295469: S390X: Optimized builds are broken
  • 63867c4: 8295433: EpsilonHeap doesn't need to override post_initialize()
  • e7375f9: 8295468: RISC-V: Minimal builds are broken
  • bd41428: 8293590: Some syntax checks performed by URL.openConnection() could be performed earlier, at URL construction
  • 78fed9d: 7175397: The divider color is not changed to green when dragging for Nimbus LaF.
  • 8c40b7d: 8292177: InitialSecurityProperty JFR event
  • e7a964b: 8295268: Optimized builds are broken due to incorrect assert_is_rfp shortcuts
  • 0b7d811: 8294730: Add @throws and @implNote clauses to BigInteger::isProblablePrime and BigInteger::nextProblablePrime
  • 4434cbb: 8295264: Fix PaX check on RISC-V
  • ... and 50 more: https://git.openjdk.org/jdk/compare/fdb74ed45240477bd08eb40ede5eaa2345ca6b5d...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 18, 2022

@bplb Pushed as commit d1f7945.

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

@bplb bplb deleted the FileChannel-pwrite-6924219 branch November 1, 2022 23:09
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 nio nio-dev@openjdk.org
2 participants