-
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
ICE going to failed now causes untyped use of closed network connection
error to be returned, breaks existing code
#252
Comments
use of closed network connection
error to be returned, breaks existing code
Where is this error being returned from? |
@jeremija candidateBase.writeTo Before these sockets were only closed during |
Thanks! Not sure if this is related, but I wanted to point out that for ICE TCP we'll have to close the unused TCP connections if they are not selected:
And reuse existing ones while renegotiating:
|
I don't have strong opinion on it, but if we catch and discard the error, we should buffer and resend the message if datachannel is set to be reliable. In any case, ice package should return an error which is parsable from the caller. - return n, fmt.Errorf("failed to send packet: %v", err)
+ return n, fmt.Errorf("failed to send packet: %w", err) to allow unwrapping. |
@at-wat sorry missed your response! The DataChannel already will do a retry, so it doesn't need this error message. So we had loss before, but we just didn't tell the user. Now we are returning the error, but I just don't think it is useful. The user should be watching the reports from ICE/RTP/SCTP individually. Making them handle the same error in two places is going to be confusing IMO. |
It is my opinion that a library should return as many error indications as possible: it is easier to ignore an error that the client application is not interested in than to work out on your own whether an error happened. The main reasons I'd be interested in synchronous error indications (as opposed to the asynchronous
It is obviously impossible to provide error indications in all cases, but it is important to avoid false positives: if an error is returned, then the packet definitely did not reach its destination. Thus, I would suggest:
|
This also breaks DataChannels unfortunately. https://github.com/pion/sctp/blob/master/association.go#L450-L454 just checks for an error. Downstream also can't check if the error is temporary, this error is because the socket is closed so it isn't temporary. |
I am going to bring back the |
Downstream isn't able to distinguish a temporary from a Permanent error yet. Relates to #252
Resolving. I am happy with how the API behaves here.
|
In #252 decide to ignore the writeTo failed error with a log, application can choose callback and query state for the connection state. But if application keep sending packet during try icerestart to recover from ICEFailed, the warn log is annoying since the error is not critical and no need to process. So change it to info.
In #252 decide to ignore the writeTo failed error with a log, application can choose callback and query state for the connection state. But if application keep sending packet during try icerestart to recover from ICEFailed, the warn log is annoying since the error is not critical and no need to process. So change it to info.
We need to fix pion/ice#252 first
Before
ice.Agent
never went to failed, so UDP sockets stayed open forever. Now because we close the sockets a user is gettinguse of closed network connection
returned to them.I feel like a user shouldn't have to worry about this, and should just have to watch
PeerConnectionState
andICEConnectionState
. During ICE Renegotiations I just wanted to keep sending packets, I don't want to worry about handling errors like this. ICE by design is lossy, so a higher level should handle this.use of closed network connection
and discard the error (but return others). This matches previous behavior.The text was updated successfully, but these errors were encountered: