Skip to content

Health-warnings for stashing callback conn handles, and try to safeguard use - #258

Merged
EnriqueL8 merged 4 commits into
mainfrom
ws-usage-checks
Oct 6, 2026
Merged

EnriqueL8 merged 4 commits into
mainfrom
ws-usage-checks

Conversation

@peterbroadhurst

Copy link
Copy Markdown
Contributor

After #247 (v1.6.6), the WSClient passed to WSPostConnectHandler is bound to a single connection. Consumers that stashed it (safe before #247) end up with a handle whose Send returns FF00147 forever once that connection reconnects or is cycled out.

This PR:

  1. Documents on the handler types that the handle is connection-bound and should not be retained beyond the callback.
  2. Adds a backwards-compatible fallback: once a previously-promoted connection's sender has exited, Send on its bound handle routes via the current connection. Sends during a cycle's quiesce period still go to the old connection, and a connection that was never promoted (failed afterConnect during a cycle) still returns FF00147.

…t against misuse

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@peterbroadhurst
peterbroadhurst requested a review from a team as a code owner October 5, 2026 18:02
@peterbroadhurst
peterbroadhurst added this pull request to stack #259 October 5, 2026 21:02

@EnriqueL8 EnriqueL8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @peterbroadhurst , one edge case on there

Comment thread pkg/wsclient/wsclient.go Outdated
Comment thread pkg/wsclient/wsclient.go Outdated
Comment thread pkg/wsclient/wsclient.go Outdated
peterbroadhurst and others added 3 commits October 6, 2026 07:47
Co-authored-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Co-authored-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Co-authored-by: Enrique Lacal <enrique.lacal@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@EnriqueL8
EnriqueL8 merged commit 26beb00 into main Oct 6, 2026
3 of 4 checks passed
@EnriqueL8
EnriqueL8 deleted the ws-usage-checks branch October 6, 2026 11:55
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.

2 participants