nta: don't abort on an outgoing transaction re-queued without progress#333
Open
garacil wants to merge 1 commit into
Open
nta: don't abort on an outgoing transaction re-queued without progress#333garacil wants to merge 1 commit into
garacil wants to merge 1 commit into
Conversation
outgoing_timer_bf() asserted that, after handling a B/F timeout, the transaction had either left the queue head or had its timeout advanced past now. outgoing_timeout() can re-queue the same orq at the head (via outgoing_try_another -> resolve/send/trying). Normally that re-queue sets a future timeout, but under load the same orq can be back at the head with a non-advanced timeout, and the assert then abort()s the whole process. Replace the assert with an anti-spin guard: if the same orq is back at the head with a non-advanced timeout, log it and stop this timer pass. The agent timer reschedules to now+1 while a head timeout is still due, so the transaction is retried on the next timer turn instead of spinning here or aborting. Fixes freeswitch#57.
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.
outgoing_timer_bf()asserted that, after handling a B/F timeout, the transaction had either left the queue head or had its timeout advanced pastnow.outgoing_timeout()can re-queue the sameorqat the head of the same queue (viaoutgoing_try_another()→ resolve / send /outgoing_trying()). Normally that re-queue sets a future timeout, but under load the sameorqcan be back at the head with a non-advanced timeout, and theassert()thenabort()s the whole process (see #57).This replaces the assert with an anti-spin guard: if the same
orqis back at the head with a non-advanced timeout, it is logged and this timer pass stops.agent_timerreschedules tonow + 1while a head timeout is still due, so the transaction is retried on the next timer turn instead of spinning here — or aborting. The normal path is unchanged.Fixes #57.