8309305: sun/security/ssl/SSLSocketImpl/BlockedAsyncClose.java fails with jtreg test timeout#14378
8309305: sun/security/ssl/SSLSocketImpl/BlockedAsyncClose.java fails with jtreg test timeout#14378mpdonova wants to merge 2 commits intoopenjdk:masterfrom
Conversation
…with jtreg test timeout
|
👋 Welcome back mdonovan! A progress list of the required criteria for merging this PR into |
Webrevs
|
Co-authored-by: Andrey Turbanov <turbanoff@gmail.com>
|
@mpdonova This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
Can someone please review this? Thanks! |
djelinski
left a comment
There was a problem hiding this comment.
LGTM.
Some OSes spontaneously increase the buffer size after a few seconds, unblocking blocked write operations. We also use 10 seconds limit in networking tests, seems to work pretty well. See
jdk/test/jdk/java/net/httpclient/websocket/PendingOperations.java
Lines 43 to 47 in 9e4fc56
|
@mpdonova 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: 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 538 new commits pushed to the
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 |
|
/integrate |
|
Going to push as commit 8042a50.
Your commit was automatically rebased without conflicts. |
This PR improves the reliability of the BlockedAsyncClose test by addressing an edge case/race condition between the two test threads. The purpose of the test is to verify that an SSLSocket can be closed if a thread is blocked in a write operation.
The test starts a "write" thread that writes data to a socket until the output buffer was filled, causing the write operation to block. The main thread then calls
SSLSocket.close(). The original code usedThread.sleep(1000)to wait for the write-thread to block. However, 1 second isn't always long enough and if the write-thread isn't blocked and the output buffer is full (or almost full), thesocket.close()call may block when it tries to send the close_notify alert. This is the condition that caused this bug.My change uses a Lock to determine if the write thread is blocked. In the write thread, the lock creates a critical section around the
write()call. The main thread usestryLock()with a timeout to determine that the write() call is taking too long and thus likely blocked.While there, I also updated the test to use the SSLContextTemplate class.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14378/head:pull/14378$ git checkout pull/14378Update a local copy of the PR:
$ git checkout pull/14378$ git pull https://git.openjdk.org/jdk.git pull/14378/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14378View PR using the GUI difftool:
$ git pr show -t 14378Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14378.diff
Webrev
Link to Webrev Comment