agent: don't wait for SMPServerHandshakeResponse when clientService not sent#1787
Open
shumvgolove wants to merge 1 commit into
Open
agent: don't wait for SMPServerHandshakeResponse when clientService not sent#1787shumvgolove wants to merge 1 commit into
shumvgolove wants to merge 1 commit into
Conversation
057253b to
e366343
Compare
…ot sent When negotiated SMP version is in [16, 18] (serviceCertsSMPVersion .. rcvServiceSMPVersion - 1) and the client has rcv-services enabled with SRMessaging role, mkClientService correctly drops the clientService portion, but the wait for SMPServerHandshakeResponse was gated on serviceKeys instead of clientService — so the client hung forever on a response the server (correctly) never sent. Gate the wait on the on-wire value clientService instead. Reproduced against smp15 (v6.5.0.14, max v18).
e366343 to
4c1bd7e
Compare
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.
Summary
When the negotiated SMP version is in
[serviceCertsSMPVersion, rcvServiceSMPVersion - 1](currently[16, 18]) and the client has rcv-services enabled withSRMessagingrole,smpClientHandshakecorrectly drops theclientServiceportion of the hello (gated bymkClientServiceagainstrcvServiceSMPVersion), but still waits forSMPServerHandshakeResponse(gated only on the broaderserviceCertsSMPVersionviaserviceKeys).The server, having received no
clientServiceto process, correctly sends no response. The client hangs indefinitely ongetHandshakeinsidegetClientService, blocking the SEND queue for that server.Fix
Gate the response wait on the on-wire value
clientService, not on the intermediateserviceKeys. If we didn't send a service portion, we shouldn't wait for one.