Repository navigation
Keep channel object alive during processReceived - #106
Merged
Merged
Conversation
michalovits
force-pushed
the
ch-keepalive
branch
from
November 4, 2026 10:30
fc8beb3 to
1690a55
Compare
michalovits
force-pushed
the
ch-keepalive
branch
from
November 4, 2026 10:32
1690a55 to
6058daf
Compare
michalovits
enabled auto-merge (squash)
November 4, 2026 10:33
flamble
approved these changes
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep a reference to the channel in
ChannelMap::processReceived. This is just defence. It makes it impossible to invalidate the channel object during this call.Currently that can't happen anyway:
ChannelMapandConnection::readHandlerkeeps the connection alive.ChannelMap::removeChannelonly runs afterChannel::processReceivedreturns (if it returnsCLEANUP).Connection::socketShutdownis only called from socket and timer callbacks, frames on channel 0 and scheduled closes, none of which can run underChannel::processReceived.createProducerAsyncorcreateConsumerAsync. If it destroys the producer, consumer or connection objects, the close is scheduled to the event loop for later.