-
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
8325579: Inconsistent behavior in com.sun.jndi.ldap.Connection::createSocket #17797
Conversation
👋 Welcome back clanger! A progress list of the required criteria for merging this PR into |
@RealCLanger The following label will be automatically applied to this pull request:
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. |
Webrevs
|
Hi Christoph, I think the proposed change is good, and it solves the problem we've also seen before with custom socket factories specified in the It would also be great to update the I've launched JNDI/LDAP regression tests with your patch and no failures were observed. |
Hi Aleksei, thanks for taking a look. Yes, I'm working on extending the test. Stay tuned. 😄 Cheers |
419f96f
to
48318eb
Compare
@RealCLanger Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
48318eb
to
c0dee34
Compare
@RealCLanger Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
So, I've updated the PR. Sorry for force-pushing, hope you didn't review the code in detail yet. The new version updates module-info as requested. I also enhanced the test |
Currently, it is hard to distinguish what part of the test responsible for JDK-8314063 testing, and which part is for JDK-8325579. |
I made some updates and addressed the review comments. I reverted the renaming of the test for the sake of reviewing. While I still think LdapSSLHandshakeTest is a better, more generic name for the test's purpose, we could change its name in a separate change. |
Hm, I think the test was overpurposed already. Creating another test file with duplicating code does not sound too good IMHO. Maybe it is acceptable without the renaming? Another question: Do we need a CSR/Release note as there is some behavioral change involved (although it should always have been like with this change)? |
/csr needed |
@AlekseiEfimov has indicated that a compatibility and specification (CSR) request is needed for this pull request. @RealCLanger please create a CSR request for issue JDK-8325579 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
This test was added by JDK-8314063 fix, and I do not think it was change after that.
I think it is acceptable. Currently, it is hard to separate the test cases for |
I drafted a CSR. @AlekseiEfimov, would be nice if you could review it. As for the test, I had a closer look now and I find it hard to separate testing of JDK-8314063 from JDK-8325579. Furthermore, most of the entries test things that hadn't been addressed by any of these two bugs at all. So, JDK-8314063 is only tested in lines 72, 73, 76 and 77 That means, most of the other test invocations test some generic behavior which was never erroneous so far. I could, however, give each line its own test id and annotate the bugs accordingly. Do you think that makes sense? |
Thanks for exploring the possibility of improving tracebility of test invocations to reported bugs.
It does make sense, but I'm not sure how such annotations will look like and if it will be easy to use them for debugging failures. I will leave the final decision to you here. Your last message with linkage of test invocations to bug id is already a good information to have.
Thanks for drafting a CSR. I will review it in comming days. |
I've given this test change a second thought, maybe you can try to separate the test into two separate test classes? One possibility to avoid duplicating code and have a separate test for each bug is to introduce a base test class that will contain the common functionality for JDK-8314063 and JDK-8325579 tests. |
I will have a look. |
@RealCLanger 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 24 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 |
I stared at the test once more but it still doesn't make sense to me to split it into multiple tests because the purposes of each test run intertwine, as stated above. The only thing that would really make sense is to rename from LdapSSLHandshakeFailureTest to LdapSSLHandshakeTest since it in fact tests various variations of the SSL handshaking. |
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. I haven't looked at the updated test too closely.
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.
The latest version looks good to me with a couple minor comments and suggestions.
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.
Latest changes LGTM
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.
The latest changes look good to me. Thank you for addressing all the comments.
I've tested the proposed change with JNDI regression tests, including the modified one, and there are no new issues discovered.
Thanks @AlekseiEfimov and @dfuch for the reviews. Submitting this now. /integrate |
Going to push as commit 907e30f.
Your commit was automatically rebased without conflicts. |
@RealCLanger Pushed as commit 907e30f. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
During analysing a customer case I figured out that we have an inconsistency between documentation and actual behavior in class com.sun.jndi.ldap.Connection. The method documentation of com.sun.jndi.ldap.Connection::createSocket states: "If a timeout is supplied but unconnected sockets are not supported then the timeout is ignored and a connected socket is created."
This, however does not happen. If a SocketFactory would not support unconnected sockets, it would likely throw a SocketException in SocketFactory::createSocket(). And since the code does not check for this behavior, a connection with timeout value through a SocketFactory that does not support unconnected sockets would simply fail with an IOException.
So we should either make the code adhere to what is documented or adapt the documentation to the actual behavior.
I hereby try to fix the connect coding. Alternatively, we could also adapt the description - I have no strong opinion. What do the experts suggest?
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17797/head:pull/17797
$ git checkout pull/17797
Update a local copy of the PR:
$ git checkout pull/17797
$ git pull https://git.openjdk.org/jdk.git pull/17797/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17797
View PR using the GUI difftool:
$ git pr show -t 17797
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17797.diff
Webrev
Link to Webrev Comment