-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
8278961: Enable debug logging in java/net/DatagramSocket/SendDatagramToBadAddress.java #6883
Conversation
…ToBadAddress.java
👋 Welcome back jpai! A progress list of the required criteria for merging this PR into |
Webrevs
|
Does the Also, I took a peek at JDK-8278858. The logs mention
which is consistent with 5 (tries) *4seconds (timeout), which suggests that either the host firewalls ICMP "destination unreachable" packets, or our |
@@ -170,6 +175,8 @@ private void test(DatagramSocket sock) throws Exception { | |||
sock.send(p); | |||
p = new DatagramPacket(buf, buf.length, addr, port); | |||
sock.receive (p); | |||
print("(unexpectedly) received data from address " + p.getAddress() | |||
+ " port " + p.getPort() + " on attempt " + i); | |||
} catch (InterruptedIOException ex) { | |||
print ("socket timeout"); | |||
} catch (Exception ex) { |
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 catch PortUnreachableException
here instead?
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.
Here too I didn't want to change the current behaviour/code of the test. It's not just this catch block but even the one a few lines above which catches InterruptedIOException
. Neither the send()
nor the receive()
APIs of DatagramSocket
specify that they throw this specific exception, but the test seems to catch it and consider it a socket timeout. So I'm guessing this test and the catch block was written with some specific context in mind and I didn't want to change that part as part of this PR which only aims to enable logging by default. Plus like Mark notes, the spec says PortUnreachableException
"may" be thrown and isn't guaranteed.
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.
Right. Looks like OSsupportsFeature
was used to filter out systems that don't send "port unreachable"; we could probably use it here if the failure turns out to be OS-specific.
Additional logs look fine.
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.
as I indicated below, we have tracked and investigated this issue and it is not purely a macosx-aarch64 issue. It may also be a test env issue. As such using the OS filtering in the test, which is designed to primarily exclued AIX, wouldn't be the appropraite approach. If we wish to exclude the test on macosx-aarch64, then use of Problemlist is more appropriate.
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.
Hello Mark,
I just noticed this comment. My understanding of the comment is that you don't expect any other changes to this test other than what has already been done in this PR to enable the debug logs? Is that correct?
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.
yes, the addition of the diagnostics is useful
@@ -170,6 +175,8 @@ private void test(DatagramSocket sock) throws Exception { | |||
sock.send(p); | |||
p = new DatagramPacket(buf, buf.length, addr, port); | |||
sock.receive (p); | |||
print("(unexpectedly) received data from address " + p.getAddress() |
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.
We should immediately fail the test here
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.
Hello Daniel,
I had considered that when doing this change. But this test itself appears to be very old one and I don't have any historical context of why it is doing these checks in a loop. Furthermore, even after it receives an exception (either a socket timeout one or any general exception), after setting a flag in case of a general exception, the test continues to run the next iteration of the loop. So I didn't want to change that logic, at least not this PR whose aim is to just enable debug logging.
However, if others too think we should fail here immediately, I'll go ahead do that change.
it is a good idea to turn on the diagnostics -- we have used it in private test runs. the current crop of failures are on macos-aarch64, it appears to be an OS issue, in that an ICMP destination unreachabale is not being generated for the UDP sends to an non existent socket end point. BUT, there is no obligation to do so -- it is not mandaotory in the spec, something along the lines: "If, in the destination host, the IP module cannot deliver the datagram because the indicated protocol module or process port is not active, the destination host may send a destination unreachable message to the source host." The question is: "is it a bug or feature in the OS?" Or it could be a host confoguration issue. There may be some configuration that has disabled ICMP, maybe a firewall policy or security setting in the kerenal, not to generate ICMP DST Unreachable responses? |
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.
Hi Jaikiran,
What you have seems appropriate to me. Hopefully the added debug information can help us better diagnose the issue (validate/invalidate some hypothesis) next time the test fails.
@@ -24,11 +24,11 @@ | |||
/* | |||
* @test | |||
* | |||
* @bug 4204320 | |||
* @bug 4204320 8278961 |
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.
Ah - can you remove 8278961 from the bug list before integrating?
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.
@bug
is supposed to be used to list the bugs that the test is verifying...
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.
Hello Daniel,
I removed that bug id and also updated the copyright year to the new year and updated the PR. No other changes.
@jaikiran 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 203 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 |
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.
LGTM. Please integrate :-)
Thank you Daniel, Mark and @djelinski for the reviews. |
/integrate |
Going to push as commit c17a012.
Your commit was automatically rebased without conflicts. |
Can I please get a review for this test only change which proposes to enable debug logs from the test that failed intermittently? This change addresses https://bugs.openjdk.java.net/browse/JDK-8278961.
The change passes the (test specific)
-d
option to enable logs from that test by default. While I was at it, I even added a few more debug logs hoping it might provide some hints if/when it fails next.For reference, a (successful) run of this test will now print something like:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6883/head:pull/6883
$ git checkout pull/6883
Update a local copy of the PR:
$ git checkout pull/6883
$ git pull https://git.openjdk.java.net/jdk pull/6883/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6883
View PR using the GUI difftool:
$ git pr show -t 6883
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6883.diff