Draft: policy-node: client error for a node must be sent before destroying it
Destroy a node only after sending the client error for it.
If the node is destroyed before sending the client error, the server will ignore the error, because the object the global id referred to is already gone.
This affects dont-reconnect nodes: previously, although client errors are sent to the PW server, it does not do anything with them because the node is already deleted.
In this case, clients will see the node deleted, but won't receive an error. This causes pw_stream clients to get a state change to PW_STREAM_STATE_UNCONNECTED, but no PW_STREAM_STATE_ERROR. Pulseaudio clients will get stream terminated with -ENOENT instead of -EIO.
This change makes
pw-play --target badtarget -P '{ node.dont-reconnect = true }' sample.ogg
to exit with an error (no node available), instead of hanging in a state where its node is destroyed but no stream error has been delivered.
-
needs a bit more testing --- not clear if some app expects to not get stream errors in this case, because the current behavior has been like this for a long time...