stream_engine_base: ignore stale restart_input after reconnect#4830
Open
lukaszsamson wants to merge 3 commits intozeromq:masterfrom
Open
stream_engine_base: ignore stale restart_input after reconnect#4830lukaszsamson wants to merge 3 commits intozeromq:masterfrom
lukaszsamson wants to merge 3 commits intozeromq:masterfrom
Conversation
restart_input can be invoked after a write_activated notification that was queued before an engine error/heartbeat reconnect. A new engine starts with input running, so _input_stopped is false and the assert was firing. Make restart_input idempotent by returning early when input was not stopped, keeping restart behavior unchanged for real EAGAIN backpressure cases.
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.
This PR reproduces and fixes the
_input_stoppedassertion crash from #3937restart_inputcan be invoked after awrite_activatednotification that was queued before an engine error/heartbeat reconnect. A new engine starts with input running, so_input_stoppedisfalseand theassert was firing. This PR makes
restart_inputidempotent by returning early when input was not stopped, keeping restart behavior unchanged for realEAGAINbackpressure cases.Detailed explanation of the bug:
#3937 (comment)
Fixes:
#3937
Possibly fixes:
#4767 (Slow subscriber, RX queue full, heartbeat triggers reset)
#4229 (HWM configured (especially rcvhwm), random crashes)
#3596 (CLIENT/SERVER, heartbeat=1s, rcvhwm=1, slow consumer)
#4364 (PUB/SUB, heartbeat with small timeouts)