Skip to content

agent: don't wait for SMPServerHandshakeResponse when clientService not sent#1787

Open
shumvgolove wants to merge 1 commit into
masterfrom
sh/fix-rcv-services
Open

agent: don't wait for SMPServerHandshakeResponse when clientService not sent#1787
shumvgolove wants to merge 1 commit into
masterfrom
sh/fix-rcv-services

Conversation

@shumvgolove
Copy link
Copy Markdown
Collaborator

@shumvgolove shumvgolove commented May 27, 2026

Summary

When the negotiated SMP version is in [serviceCertsSMPVersion, rcvServiceSMPVersion - 1] (currently [16, 18]) and the client has rcv-services enabled with SRMessaging role, smpClientHandshake correctly drops the clientService portion of the hello (gated by mkClientService against rcvServiceSMPVersion), but still waits for SMPServerHandshakeResponse (gated only on the broader serviceCertsSMPVersion via serviceKeys).

The server, having received no clientService to process, correctly sends no response. The client hangs indefinitely on getHandshake inside getClientService, blocking the SEND queue for that server.

Fix

Gate the response wait on the on-wire value clientService, not on the intermediate serviceKeys. If we didn't send a service portion, we shouldn't wait for one.

- service <- forM serviceKeys $ \sks -> getClientService sks
+ service <- case clientService of
+   Just _  -> forM serviceKeys $ \sks -> getClientService sks
+   Nothing -> pure Nothing

…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).
@shumvgolove shumvgolove force-pushed the sh/fix-rcv-services branch from e366343 to 4c1bd7e Compare May 28, 2026 13:10
@shumvgolove shumvgolove changed the title agent: do not attach service cert to foreign destination servers agent: don't wait for SMPServerHandshakeResponse when clientService not sent May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant