Skip to content

Conversation

ofekby
Copy link

@ofekby ofekby commented Jul 6, 2025

This pull request makes a small but important change to the retry logic in the __retry method of the src/aioice/stun.py file. The change ensures that the TransactionTimeout exception is not redundantly set if the future is already completed.

  • src/aioice/stun.py: Modified the condition in the __retry method to check if the future (self.__future) is not already done before setting the TransactionTimeout exception. This prevents unnecessary operations and potential errors.

We experience this case in production here is the stacktrace:

Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 253, in uvloop.loop.TimerHandle._run
  File "[masked]/aioice/stun.py", line 330, in __retry
    self.__future.set_exception(TransactionTimeout())
asyncio.exceptions.InvalidStateError: invalid state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant