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

8282036: Change java/util/zip/ZipFile/DeleteTempJar.java to stop HttpServer cleanly in case of exceptions #9293

Closed
wants to merge 3 commits into from

Conversation

thejasviv
Copy link
Member

@thejasviv thejasviv commented Jun 27, 2022

This is a simple change to add some protective code to java/util/zip/ZipFile/DeleteTempJar.java so that the clean-up is more complete in the event of encountering an any exceptions while running. In the present state, the server.stop() does not get executed in case of encountering a failure. As a result, the test may get hung until a timeout. This fix should address the scenario.

The test passes on all supported platforms post fix.


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

Issue

  • JDK-8282036: Change java/util/zip/ZipFile/DeleteTempJar.java to stop HttpServer cleanly in case of exceptions

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9293

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

Using diff file

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

…top HttpServer cleanly in case of exceptions
@bridgekeeper
Copy link

bridgekeeper bot commented Jun 27, 2022

👋 Welcome back tvoniadka! 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 Jun 27, 2022
@openjdk
Copy link

openjdk bot commented Jun 27, 2022

@thejasviv 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 Jun 27, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 27, 2022

Webrevs

@jaikiran
Copy link
Member

Hello Thejasvi, the change looks good to me. Please update the copyright year to 2022 in this changed file.

if (server != null) {
server.stop(0);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to put the server.start in the try block, I would think this is simpler:

server.start();
try {
    :
} finally {
    server.stop(0);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you @jaikiran , @AlanBateman for your reviews. I have updated the patch with your inputs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry @jaikiran , I somehow missed the comment on the null check. Have fixed it now, thank you!

…top HttpServer cleanly in case of exceptions
check(f.getEntry("entry") != null);
System.out.println(f.getName());
} finally {
if (server != null) {
Copy link
Member

Choose a reason for hiding this comment

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

The null check can be removed here as suggested by Alan.

…top HttpServer cleanly in case of exceptions
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.

Thank you for doing those changes. The latest state of this PR looks good to me.

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

Looks okay. You'll ned to edit the edit the title to align with the description of the JBS issue before you can integrate.

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.

Looks reasonable to me.

@thejasviv thejasviv changed the title 8282036: [Test]: Update java/util/zip/ZipFile/DeleteTempJar.java to stop HttpServer cleanly in case of exceptions 8282036: Change java/util/zip/ZipFile/DeleteTempJar.java to stop HttpServer cleanly in case of exceptions Jun 27, 2022
@openjdk
Copy link

openjdk bot commented Jun 27, 2022

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

8282036: Change java/util/zip/ZipFile/DeleteTempJar.java to stop HttpServer cleanly in case of exceptions

Reviewed-by: jpai, alanb, dfuchs

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

  • f3f0788: 8288746: HttpClient resources could be reclaimed more eagerly
  • be6be15: 8288750: IGV: Improve Shortcuts
  • 210a06a: 8287227: Shenandoah: A couple of virtual thread tests failed with iu mode even without Loom enabled.
  • 64f95cf: 8012675: javax.swing.JEditorPane is unclear on the handling of unsupported HTML script tags
  • ddb55ed: 8135292: Remove duplicate code in Address.java in SA
  • 7905788: 8289126: Cleanup unnecessary null comparison before instanceof check in jdk.hotspot.agent
  • 47fe9ef: 8289078: Make STARTTIME_ANY and STARTTIME_PROCESS_UNKNOWN fields static in ProcessHandleImpl
  • 62e1e79: 8289147: unify os::infinite_sleep on posix platforms
  • de74671: 8266670: Better modeling of access flags in core reflection
  • a5c25d8: 8286395: Address possibly lossy conversions in java.security.jgss
  • ... and 25 more: https://git.openjdk.org/jdk/compare/5b583e4792b1d59891495a4a050fcdd4d38dfee1...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.

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 (@jaikiran, @AlanBateman, @dfuch) 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 openjdk bot added the ready Pull request is ready to be integrated label Jun 27, 2022
@thejasviv
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jun 27, 2022
@openjdk
Copy link

openjdk bot commented Jun 27, 2022

@thejasviv
Your change (at version 498ed31) is now ready to be sponsored by a Committer.

@jaikiran
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 28, 2022

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

  • ca78f7b: 8286259: Password cleanup after KeyStore.PasswordProtection in P11KeyStore
  • e322e77: 8288651: CDS test HelloUnload.java should not use literal string as ClassLoader name
  • 40bf3b1: 8288993: Make AwtFramePackTest generic by removing @requires tag
  • d4b040f: Merge
  • 7e13cdb: 8289079: java/lang/Thread/jni/AttachCurrentThread/AttachTest.java#id1 failed with "RuntimeException: Test failed"
  • 9c92da5: 8247407: tools/jlink/plugins/CompressorPluginTest.java test failing
  • 7ac40f3: 8288983: broken link in com.sun.net.httpserver.SimpleFileServer
  • 20f55ab: 8289044: ARM32: missing LIR_Assembler::cmove metadata type support
  • bdf9902: 8288120: VerifyError with JEP 405 pattern match
  • b0db333: 8288528: broken links in java.desktop
  • ... and 41 more: https://git.openjdk.org/jdk/compare/5b583e4792b1d59891495a4a050fcdd4d38dfee1...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 28, 2022
@openjdk openjdk bot closed this Jun 28, 2022
@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 Jun 28, 2022
@openjdk
Copy link

openjdk bot commented Jun 28, 2022

@jaikiran @thejasviv Pushed as commit 784fa0a.

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

@thejasviv
Copy link
Member Author

Thank you much @jaikiran for timely reviews, feedback, and sponsoring this commit. Also thank you @AlanBateman and @dfuch for your kind review and feedback.

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
4 participants