Skip to content

impl-client: check global id registry generation in client.error method

P V requested to merge pvir/pipewire:client-error-idfix into master

In client.error method, require that the global id in the message refers to an existing registered global known to the sender of the message. If not, do not try forwarding errors to the resources.

Also emit errors on the sender client resource in this case, so that the sender client gets to know that what it tried to do didn't work.

This addresses a race condition where session manager sends a client error for a global id, but before server processed that message the global got deleted and the id reused for a different object, resulting to an error being sent to the wrong resource. See #3192 (closed).

Wireplumber & pipewire-media-session do this on non-reconnectable node connection failures: they first delete the node, and then try to send a client error for its id. However, the global and its resources then usually are already deleted at that point, and there are no resources to send messages to so that is a no-op, except in the race condition where id gets reused and the message goes to the wrong object.

They should do it in the opposite order. That it is wrong is also visible in that

pw-play --target badtarget -P '{ node.dont-reconnect = true }' sample.ogg

hangs instead of bailing out, which is what happens also before this commit.

Merge request reports

Loading