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

8259943: FileDescriptor.close0 does not handle EINTR #2173

Closed
wants to merge 3 commits into from

Conversation

@bplb
Copy link
Member

@bplb bplb commented Jan 20, 2021

Please review this small change to handle EINTR from close() in fileDescriptorClose(). The function handleGetLength() is also changed to handle EINTR from fstat64() to match other uses of fstat64() in the file.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8259943: FileDescriptor.close0 does not handle EINTR

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2173/head:pull/2173
$ git checkout pull/2173

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jan 20, 2021

👋 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 label Jan 20, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 20, 2021

@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 label Jan 20, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jan 20, 2021

Webrevs

@naotoj
naotoj approved these changes Jan 20, 2021
Copy link
Member

@naotoj naotoj left a comment

Looks good, Brian.

@openjdk
Copy link

@openjdk openjdk bot commented Jan 20, 2021

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

8259943: FileDescriptor.close0 does not handle EINTR

Reviewed-by: naoto, 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 33 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.

➡️ 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 label Jan 20, 2021
JNU_ThrowIOExceptionWithLastError(env, "close failed");
} else {
int result;
RESTARTABLE(close(fd), result);

This comment has been minimized.

@AlanBateman

AlanBateman Jan 21, 2021
Contributor

close is not restartable (except AIX apparently). This means you have to explicitly handle EINTR, see UnixNativeDispatcher.close0 for an example.

This comment has been minimized.

@bplb

bplb Jan 21, 2021
Author Member

I had it that way before creating the PR; will revert.

#else
result = close(fd);
#endif
if (result == -1) {

This comment has been minimized.

@AlanBateman

AlanBateman Jan 21, 2021
Contributor

This needs to be if (result == -1 && errno != EINTR)

This comment has been minimized.

@bplb

bplb Jan 21, 2021
Author Member

Yes, I already caught and fixed that gaffe.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jan 21, 2021

Mailing list message from Brian Burkhalter on core-libs-dev:

On Jan 21, 2021, at 11:06 AM, Alan Bateman <alanb at openjdk.java.net> wrote:

On Thu, 21 Jan 2021 18:56:59 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

Please review this small change to handle `EINTR` from `close()` in `fileDescriptorClose()`. The function `handleGetLength()` is also changed to handle `EINTR` from `fstat64()` to match other uses of `fstat64()` in the file.

Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:

8259943: Suppress RESTARTABLE for non-AIX.

src/java.base/unix/native/libjava/io_util_md.c line 173:

171: result = close(fd);
172: #endif
173: if (result == -1) {

This needs to be `if (result == -1 && errno != EINTR)`

Yes I already caught and fixed that gaff.

@bplb
Copy link
Member Author

@bplb bplb commented Jan 21, 2021

/integrate

@openjdk openjdk bot closed this Jan 21, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jan 21, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 21, 2021

@bplb Since your change was applied there have been 34 commits pushed to the master branch:

  • a8073ef: 8253478: (se) epoll Selector should use eventfd for wakeup instead of pipe
  • 34eb8b3: 8255765: Shenandoah: Isolate concurrent, degenerated and full GC
  • c3c6662: 8259954: gc/shenandoah/mxbeans tests fail with -Xcomp
  • 6ce0799: 8259851: Use boolean type for tasks in SubTasksDone
  • 4bcffeb: 8260029: aarch64: fix typo in verify_oop_array
  • e1de0bf: 8260043: Reduce allocation in sun.net.www.protocol.jar.Handler.parseURL
  • 4dfd8cc: 8259897: gtest os.dll_address_to_function_and_library_name_vm fails on AIX
  • 7f7166d: 8260035: Deproblemlist few problemlisted test
  • 5940287: 8260048: Shenandoah: ShenandoahMarkingContext asserts are unnecessary
  • f8a9602: 8260025: Missing comma in VM_Version_Ext::_family_id_amd
  • ... and 24 more: https://git.openjdk.java.net/jdk/compare/5d8861b03d06bf3670c6e052e11a93b7f8894e35...master

Your commit was automatically rebased without conflicts.

Pushed as commit 2f47c39.

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

@bplb bplb deleted the bplb:8259943-fileDescriptorClose branch Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants