Skip to content

Conversation

murgatroid99
Copy link
Member

nodejs/node#49147 shows that in some rare scenarios, calling end in the write callback can put the whole session into a bad state, where the socket is closed but the session is treated as still open. This could cause the symptoms described in #2502. nodejs/node#49147 (comment) indicates that this problem does not occur if the contents of the write callback are enclosed in process.nextTick, so that's what I did here. In case stream.close in the write callback can cause the same problem, all of the code in the callback is enclosed in process.nextTick. This callback is already always asynchronous with respect to other code, so other than avoiding this bug, this change should have no observable effects to user code.

@murgatroid99 murgatroid99 merged commit cd25bad into grpc:@grpc/[email protected] Aug 22, 2023
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