Commit 89346fa9 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

threadshare/udpsink: Don't hold settings lock while calling into the sink pad...

threadshare/udpsink: Don't hold settings lock while calling into the sink pad handler to clear the clients

Otherwise we can deadlock because of a lock order issue:
 - render() is called with the sink pad handler lock and takes the
   settings lock
 - clearing clients takes the sink pad handler lock
parent 98b618cc
......@@ -1403,10 +1403,12 @@ impl ObjectImpl for UdpSink {
.expect("type checked upstream")
.unwrap_or_else(|| "".into());
let current_client = settings
.host
let host = settings.host.clone();
let port = settings.port;
let current_client = host
.iter()
.filter_map(|host| try_into_socket_addr(&element, host, settings.port).ok());
.filter_map(|host| try_into_socket_addr(&element, &host, port).ok());
let clients_iter = current_client.chain(clients.split(',').filter_map(|client| {
let rsplit: Vec<&str> = client.rsplitn(2, ':').collect();
......@@ -1429,6 +1431,7 @@ impl ObjectImpl for UdpSink {
None
}
}));
drop(settings);
self.clear_clients(clients_iter);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment