aioice
aioice copied to clipboard
Multiple early checks from same source results in unhandled tasks
Tested on version 0.7.6.
If multiple checks from a remote peer arrive before _check_list from Connection class is set, then all of them are appended to the _early_checks list and then acted upon on the connect method:
# handle early checks
for early_check in self._early_checks:
self.check_incoming(*early_check)
self._early_checks = []
Then the check_incoming method creates a task for each early check and overwrites the handle for the associated pair:
pair.handle = asyncio.ensure_future(self.check_start(pair))
Since the handle for some tasks is lost, they become unreachable and are not canceled after completion.
It is even possible to see mutiple times a transition State.IN_PROGRESS -> State.IN_PROGRESS
for some candidate pairs.
Sounds like a valid point, would you be ready to contribute a PR?
I noticed this as well. Any updates @ddiaz-yx ?
I created a PR that do not start a check if a check is already ongoing: https://github.com/aiortc/aioice/pull/68
Fixed in https://github.com/aiortc/aioice/commit/54a575139b398a5d168512bc8c26b13d868068ce, thanks @eerimoq