Repository navigation
fix(lib-rt-ws-registry): tell the other clients when one of them has gone - #201
Conversation
…gone A lost message notification goes to every client the sender named, and two of the three places that sent one gave up as soon as a write failed. The ack worker unwrapped its send, so a client that could no longer be written to took the worker down and every acknowledgement pending on the node with it. The local path used the question mark operator, so the first failure returned a write error in place of the lost message error and the clients named after it heard nothing. Neither is unusual enough to treat as impossible. A connection can go at any moment, and a message being declared lost is itself a sign that something is already wrong with the connections involved. Both now go through the helper that was sitting between them, which logs a write that failed and carries on to the rest. The test names the gone client first, so an implementation that stops at the first failure never reaches the client still listening. Its socket is built by hand with a zero linger so that dropping it resets the connection rather than closing it, because a write into a half closed socket succeeds and the first version of the test passed against the unfixed code three times over.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe WebSocket registry now uses ChangesMessage-loss notifications
Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to This localized change improves notification handling for disconnected clients, and no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Description
A lost message notification goes to every client the sender named, and two of the three places that sent one gave up as soon as a write failed. The ack worker unwrapped its send, so a client that could no longer be written to took the worker down and every acknowledgement pending on the node with it. The local path used the question mark operator, so the first failure returned a write error in place of the lost message error and the clients named after it heard nothing.
Neither is unusual enough to treat as impossible. A connection can go at any moment, and a message being declared lost is itself a sign that something is already wrong with the connections involved.
Both now go through the helper that was sitting between them, which logs a write that failed and carries on to the rest.
The test names the gone client first, so an implementation that stops at the first failure never reaches the client still listening. Its socket is built by hand with a zero linger so that dropping it resets the connection rather than closing it, because a write into a half closed socket succeeds and the first version of the test passed against the unfixed code three times over.
Summary by CodeRabbit