-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
UDP socket leaks #608
Comments
From the output of ---EDIT 1------- After adding some debug log, it seems there are an orphan task that never quit: https://github.com/webrtc-rs/webrtc/blob/master/dtls/src/conn/mod.rs#L322 |
I'm stuck, but with some findings:
It might related to the screenshot above, for some reason, the task created at agent_gather.rs:773 lost its waker, so the UdpSocket never released. |
Update: I have been using I created a tokio task to spy on it, so the actual reference count is 5 which causing this problem. |
Finally, It leads to one possible line: webrtc/ice/src/agent/agent_transport.rs Line 244 in 23bbc1f
But there is still 1 leaking UdpSocket. |
Great catch, could you submit a PR to fix it? Thanks |
No problem, will submit a PR if there are no more leaks. |
Addition to: #608 (comment)
|
Line 322 in 23bbc1f
|
I'm quite confused about why we should release these structures manually, is there a reference loop for |
I'm also seeing some odd behavior here. I have to manually impl<'a> Drop for P2PConnection<'a> {
fn drop(&mut self) {
futures::executor::block_on(async move {
let _ = self.data_channel.close().await;
println!("Data Channel has been closed");
let _ = self.connection.close().await;
println!("Connection has been closed");
});
}
} |
This is the code in question that I believe is causing hangups in my project: https://github.com/dbidwell94/rust_p2p/blob/master/src/p2p_connection.rs#L187-L196 And the test in question is here: https://github.com/dbidwell94/rust_p2p/blob/master/src/p2p_connection.rs#L241 You should be able to easily pull the code down and run |
I have a program working as a proxy to convert RTSP stream to WebRTC stream so I can visit my cameras on the browser, normally a connection is closed when I close the tab, and I'm monitoring the ICE state to close PeerConnection, every time I call
PeerConnection.close().await
it complains:and all the UDP socket is never closed, I have confirmed that by
lsof -n -p $pid
.The text was updated successfully, but these errors were encountered: