Skip to content

Draft: respawn: Respawn a module that exits

Craig Howard requested to merge c33howard/pulseaudio:respawn into master

When the local pulseaudio daemon is acting as a client and the remote server exits for any reason, then the client module exits. In most cases, the server will return relatively soon, as it probably went down for a transient failure, like a process restart or reboot.

Rather than building reconnect logic into every network client module, module-respawn just reloads the module after it exits. In order to minimize reconnect noise, it does an exponential back-off up to a cap.

The only required parameter for module-respawn is module=, which is the name of the module to load. All module parameters that being with an underscore are passed to the child module (with the underscore removed). module-respawn takes some optional parameters to control the exponential back-off.

Fixes: #875 (closed)

--

I'm particularly interested in feedback on whether a respawn module fits with pulseaudio's architecture and on the configuration syntax; it feels a bit awkward. Example config:

module-respawn module=module-tunnel-sink-new _server=pulse.example.com _sink=laptop-sink _sink_name=remote-sink

I've been running this locally for about a week now, between a docked laptop from my employer, and my personal desktop machine that has connected speakers. I've done multiple reboots, etc of my desktop machine and the laptop has behaved as expected throughout.

Merge request reports