stream_engine_base: ignore stale restart_input after reconnect #4830
+109
−1
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)