-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8297798: Timeout with DTLSOverDatagram test template #11558
Conversation
👋 Welcome back mpdonova! A progress list of the required criteria for merging this PR into |
Webrevs
|
Since this fix will address intermittent failures from these 5 tests, can we close those 5 bugs as duplicate of this fix? |
I'm not completely comfortable marking them as duplicate because there are a few different errors going on and I wasn't able to reproduce them. Can we mark mark them as "cannot reproduce" and include a link to this fix? |
@@ -338,20 +328,33 @@ void receiveAppData(SSLEngine engine, | |||
} | |||
} | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: fix comment formatting
System.out.println("Exception on client side: "); | ||
e.printStackTrace(System.out); | ||
exc.printStackTrace(System.out); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we log these stack traces to System.err?
|
||
if (testCase.isGoodJob()) { | ||
return "Well done, server!"; | ||
throw e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this flipped, earlier if isGoodJob() returns false then we throw exception.
} catch (Exception e) { | ||
System.out.println("Exception in ClientCallable.call():"); | ||
e.printStackTrace(System.out); | ||
clientException = e; | ||
|
||
if (testCase.isGoodJob()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Check if this is method is even used and what is the purpose of it. You may not need these checks and would prefer to have no try-catch in this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used by InvalidRecords.java test. It expects handshake to fail so overrides this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored the code to be a bit cleaner.
The InvalidRecords.java test explicitly threw an exception that is then treated as a successful test run. I refactored the test a little so it only throws an exception if the test fails.
Since all of those related bugs were for timeout, I am fine to close them as duplicate. But no objection to "cannot reproduce" as well. |
from the server. The server thread had exitted normally so the read _should_ | ||
succeed. So let's try to read a couple times before giving up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from the server. The server thread had exitted normally so the read _should_ | |
succeed. So let's try to read a couple times before giving up. | |
from the server. The server thread had exited normally so the read _should_ | |
succeed. So let's try to read a couple of times before giving up. |
@@ -401,7 +402,7 @@ boolean produceHandshakePackets(SSLEngine engine, SocketAddress socketAddr, | |||
return false; | |||
} | |||
|
|||
DatagramPacket createHandshakePacket(byte[] ba, SocketAddress socketAddr) { | |||
DatagramPacket createHandshakePacket(byte[] ba, SocketAddress socketAddr){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DatagramPacket createHandshakePacket(byte[] ba, SocketAddress socketAddr){ | |
DatagramPacket createHandshakePacket(byte[] ba, SocketAddress socketAddr) { |
} | ||
} | ||
try { | ||
testCase.doClientSide(socket, serverSocketAddr); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the updates! LGTM other than few minor format changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good to me.
@@ -36,27 +36,32 @@ | |||
|
|||
import java.net.DatagramPacket; | |||
import java.net.SocketAddress; | |||
import java.util.concurrent.atomic.AtomicBoolean; | |||
|
|||
/** | |||
* Test that if handshake messages are crasged, the handshake would fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crasged? Was that supposed to be "changed?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the typo.
@Override | ||
DatagramPacket createHandshakePacket(byte[] ba, SocketAddress socketAddr) { | ||
if ((ba.length >= 60) && | ||
if (needInvalidRecords.get() && (ba.length >= 60) && | ||
(ba[0x00] == (byte)0x16) && (ba[0x0D] == (byte)0x01) && | ||
(ba[0x3B] == (byte)0x00) && (ba[0x3C] > 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to make sure - this test is only designed to be run for initial handshakes with cookies, not resumed handshakes, correct? I assume that is the intent since this test dates back to the initial DTLS release where resumptions didn't use cookies (that was a recent change to include support for resumption cookies).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. The test driver (DTLSOverDataGram) doesn't do session resumption.
@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 183 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. 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 (@jnimeh, @rhalade) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
/sponsor |
Going to push as commit 4b313b5.
Your commit was automatically rebased without conflicts. |
This fix is intended to address various time-out errors in tests that use DTLSOverDatagram as a test template. Based on test output from those bugs (JDK-8202059, JDK-8249562, JDK-8280185, JDK-8280186, JDK-8269887, JDK-8268899), this fix:
Ran the following tests 200 times each with no failures.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11558/head:pull/11558
$ git checkout pull/11558
Update a local copy of the PR:
$ git checkout pull/11558
$ git pull https://git.openjdk.org/jdk pull/11558/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11558
View PR using the GUI difftool:
$ git pr show -t 11558
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11558.diff