-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear selected pair on ICE failed #612
Conversation
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
When ICE times out and fails, all candidates are deleted. That means all the candidates are closed and their underlying conns are clsoed. But, the selected pair could still be valid. On a subsequenct `Write`, ICE transport conn will get the selected pair and write to the pair. As the pair is still valid, write will flow through to the local candidate `writeTo`. But, as all candidates and their underlying conns are closed, `Write` will return a `io.ErrClosedPipe` error. There are cases where it is not ignored and causes a broken pipe after an ICERestart. When the `Write` error propagates back to sctp/association, the writeLoop is exited. So, sending data channel traffic after a successful ICERestart still fails as the SCTP association errored out and write loop exited. I have copied the changes that are done when ICERestart happens to when ICE state is set to failed (except for gathering state and resetting ufrag/pwd). In my testing, it is working well, i. e. can continue data channel after ICE Restart whereas previously it was failing every time. But, I am not sure of all the implications of this change. Update authors Update AUTHORS.txt
17c38f0
to
54ae7ea
Compare
To elaborate more on my concerns that I mentioned in the PR commit notes,
Agreed that the possibility of that happening is small, but it is still a possibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
I don't see any issues with locking interactions. For the second concern, I think the expectation is that a restart is necessary after reaching failed state. so when ICE Restart is performed, the same logic will be executed again.
Agreed on the last one.. I guess that can be addressed separately since that race is not introduced by this PR.
Merging this based on @davidzhao 's review + approval. If there is further feedback, I will address it in a subsequent PR. |
When ICE times out and fails, all candidates are deleted.
That means all the candidates are closed and their underlying conns are clsoed.
But, the selected pair could still be valid. On a subsequenct
Write
, ICE transport conn will get the selected pair and write to the pair. As the pair is still valid, write will flow through to the local candidatewriteTo
.But, as all candidates and their underlying conns are closed,
Write
will return aio.ErrClosedPipe
error.There are cases where it is not ignored and causes a broken pipe after an ICERestart.
When the
Write
error propagates back to sctp/association, the writeLoop is exited.So, sending data channel traffic after a successful ICERestart still fails as the SCTP association errored out and write loop exited.
I have copied the changes that are done when ICERestart happens to when ICE state is set to failed (except for gathering state and resetting ufrag/pwd). In my testing, it is working well, i. e. can continue data channel after ICE Restart whereas previously it was failing every time. But, I am not sure of all the implications of this change.