Fix retry logic to prevent setting exception if future is already done#100
Fix retry logic to prevent setting exception if future is already done#100ofekby wants to merge 9 commits into
Conversation
|
This looks like a good catch, could you please prepare a unit test which exercises this scenario? |
Thanks! @jlaine The test fails consistently when the future-guard fix is commented out, confirming that the test reliably captures the issue. To detect the raised exception ( |
This pull request makes a small but important change to the retry logic in the
__retrymethod of thesrc/aioice/stun.pyfile. The change ensures that theTransactionTimeoutexception is not redundantly set if the future is already completed.src/aioice/stun.py: Modified the condition in the__retrymethod to check if the future (self.__future) is not already done before setting theTransactionTimeoutexception. This prevents unnecessary operations and potential errors.We experience this case in production here is the stacktrace: