Ticket #752 (closed defect: fixed)
[PATCH] asyncns timeout causes delay when pulseaudio service not running
| Reported by: | jezaustin | Owned by: | lennart |
|---|---|---|---|
| Milestone: | 0.9.22 | Component: | core |
| Keywords: | asyncns timeout socket DNS | Cc: |
Description
Client applications try to connect to pulseaudio, and if there is no service running the pa_context_connect function blocks for about 5s. I discovered this through testing the firefox betas (https://bugzilla.mozilla.org/show_bug.cgi?id=533470), and I've also raised the issue with libcanberra (http://bugs.freedesktop.org/show_bug.cgi?id=25742).
To reproduce: 1) compile pulseaudio with HAVE_ASYNCNS. 2) make sure pulse is not running 3) run any application which attempts a pa_context_connect.
There is no delay at all if either a) pulseaudio process is running, or b) pulseaudio is compiled without HAVE_ASYNCNS.
When the symptoms are showing, an error message "socket(): Address family not supported by protocol" is displayed immediately, then the delay is experienced after which the client application resumes. I think that pulsecore/socket-client.c:486 in pa_socket_client_new_string calls asyncns_getaddrinfo which produces the error message, then line 487 calls start_timeout which produces the delay.
Is there any way of avoiding the timeout when using ASYNCNS?
