Repository navigation
Commit 2f747a7
committed
protocol-native: add 5s handshake timeout to prevent indefinite hangs
When the PipeWire daemon is alive but hung (e.g. after lockfile
staleness or during a deadlock), clients connecting via
pw_protocol_native_connect_local_socket() use SOCK_NONBLOCK.
The connect() succeeds immediately but the protocol handshake
never completes, causing wpctl, pactl, and libwireplumber clients
to hang indefinitely.
This adds a spa timer to impl_connect_fd() that fires after
CONNECT_TIMEOUT_MS (5000 ms). If the connection hasn't completed
by then, the timer callback destroys the IO source and emits
-ETIMEDOUT to the core, unblocking the client.
Fixes: wpctl/pactl hangs when pipewire daemon is alive but
unresponsive (e.g. after stale lockfile)
CVE: N/A
See: https://gitlab.freedesktop.org/pipewire/wireplumber/-/work_items1 parent 85df114 commit 2f747a7
1 file changed
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
| |||
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
227 | 259 | | |
228 | 260 | | |
229 | 261 | | |
| |||
1205 | 1237 | | |
1206 | 1238 | | |
1207 | 1239 | | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
1208 | 1243 | | |
1209 | 1244 | | |
1210 | 1245 | | |
1211 | 1246 | | |
1212 | 1247 | | |
1213 | | - | |
| 1248 | + | |
1214 | 1249 | | |
1215 | 1250 | | |
1216 | 1251 | | |
1217 | 1252 | | |
1218 | 1253 | | |
1219 | 1254 | | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1220 | 1262 | | |
1221 | 1263 | | |
1222 | 1264 | | |
| |||
1230 | 1272 | | |
1231 | 1273 | | |
1232 | 1274 | | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1233 | 1280 | | |
1234 | 1281 | | |
1235 | 1282 | | |
| |||
0 commit comments