Assertion of pending transport when retransmission timer fires #4037
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.
Reported that this assertion is raised:
with call stack:
Normally when a transport is pending (due to async resolve/connect/send),
TSX_HAS_PENDING_TRANSPORT
will be set and transaction will not start the retransmission timer. It will just set transport flagTSX_HAS_PENDING_RESCHED
so the retransmission timer will be started later after the operation is done. SoTSX_HAS_PENDING_TRANSPORT
should never be set when the retransmission timer fires (hence the assertion check is there).However,
tsx_retransmit()
seems to restart the retransmission timer before performing the send operation, so there may be a condition that the sending is async (TSX_HAS_PENDING_TRANSPORT
is set) and the retransmission timer is started. Note that normally the order should be the other way around (i.e: send first, start the timer when transport is not pending), code comment says something about loop transport, but I don't really understand it, so I don't want to change it.Also note that retransmission interval is usually much longer than delay in async operation, hence the assertion should be rarely raised. But on IP change scenario, recreating & reconnecting transport may take longer than retransmission interval.