mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
avahi: Resolve hosts for which name resolution fails.
This avoids attempts to connect to hosts that went off-line. This is particularly important for 'guix-daemon --discover', which would so far keep attempting to talk to LAN hosts after they vanished just because their mDNS record hasn't expired, leading to significant delays when fetching narinfos and substitutes. * guix/avahi.scm (avahi-browse-service-thread)[service-resolver-callback]: Add handler to RESOLVER-EVENT/FAILURE.
This commit is contained in:
parent
99a27d361e
commit
248cf06149
1 changed files with 9 additions and 1 deletions
|
@ -137,7 +137,15 @@ (define (service-resolver-callback resolver interface protocol event
|
|||
(port port)
|
||||
(txt txt))))
|
||||
(hash-set! %known-hosts service-name service*)
|
||||
(proc 'new-service service*)))))
|
||||
(proc 'new-service service*))))
|
||||
((eq? event resolver-event/failure)
|
||||
;; Failure to resolve the host associated with a service. This
|
||||
;; usually means that the mDNS record hasn't expired yet but that
|
||||
;; the host went off-line.
|
||||
(let ((service (hash-ref %known-hosts service-name)))
|
||||
(when service
|
||||
(proc 'remove-service service)
|
||||
(hash-remove! %known-hosts service-name)))))
|
||||
(free-service-resolver! resolver))
|
||||
|
||||
(define (service-browser-callback browser interface protocol event
|
||||
|
|
Loading…
Reference in a new issue