Skip to content

core: destroy parser on disconnect in libuv-adapter mode - #1008

Open
arnaudhe wants to merge 1 commit into
nats-io:mainfrom
loft-orbital:users/arnaudhe/parser_destroy_on_disconnect
Open

core: destroy parser on disconnect in libuv-adapter mode#1008
arnaudhe wants to merge 1 commit into
nats-io:mainfrom
loft-orbital:users/arnaudhe/parser_destroy_on_disconnect

Conversation

@arnaudhe

@arnaudhe arnaudhe commented Aug 5, 2026

Copy link
Copy Markdown

Description

Fix an issue where protocol parser is not destroyed at disconnect when running with libuv adapter. Implements deferred destroy via a bool psReset flag on natsConnection.

Related Issues

Fixes #1007

@AdamPayzant AdamPayzant left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The changes look good to me, but please add a test for these changes. If you need help or want me to do it just let me know

@kozlovic

kozlovic commented Aug 5, 2026

Copy link
Copy Markdown
Member

@AdamPayzant Not sure how the user can test that in the test suite to be honest. Would have to be using a mock, capture the nc->ps address, send a bad protocol, make sure that nc->ps is changed I guess?

@AdamPayzant

Copy link
Copy Markdown
Collaborator

@kozlovic Maybe I didn't look at it deep enough, but I thought test_EventLoop essentially already had that groundwork done? At least enough for testing changes in natsConnection_ProcessReadEvent

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.

libuv adapter: parser not destroyed on disconnect

3 participants