Repository navigation
Conversation
unbind() only closed the socket, so the server never received an UnbindRequest. Send it before closing. LdapNetworkConnection.unBind() waits until the server closes the session, so the timeout of the connection is lowered for that call: closing a connection must not hang. The UnbindRequest is checked on the wire with a local socket, and unbind() is also covered against the configured servers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA: https://issues.apache.org/jira/browse/DIRSTUDIO-1295
ConnectionWrapper.unbind()only closed the socket, so the server never received an UnbindRequest and kept the session until it timed out.unbind()now sends the UnbindRequest before closing the socket, so the server logs a clean close.LdapNetworkConnection.unBind()waits until the server closes the session, up to the connection timeout. I lower the timeout to 1 s for that call, so closing a half-dead connection cannot block a job for 30 s; the socket is closed right after in any case.Tests:
UnbindOnWireTest(new): with a local socket and no LDAP server at all, checks thatunbind()emits the UnbindRequest bytes (30 05 02 01 .. 42 00) and that a plaindisconnect()emits nothing.testUnbindinDirectoryApiConnectionWrapperTest: against the configured servers, the connection is closed and a secondunbind()call is harmless.Full build and tests pass with Maven 3.8.8 / JDK 17 against ApacheDS.