GNU bug report logs - #45314
‘guix discover’ polls

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Fri, 18 Dec 2020 17:11:01 UTC

Severity: normal

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45314 in the body.
You can then email your comments to 45314 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to othacehe <at> gnu.org, bug-guix <at> gnu.org:
bug#45314; Package guix. (Fri, 18 Dec 2020 17:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to othacehe <at> gnu.org, bug-guix <at> gnu.org. (Fri, 18 Dec 2020 17:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: bug-guix <at> gnu.org
Subject: ‘guix discover’ polls
Date: Fri, 18 Dec 2020 18:10:04 +0100
[Message part 1 (text/plain, inline)]
Hi!

‘guix discover’ polls with 100ms intervals:

--8<---------------cut here---------------start------------->8---
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 (Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 (Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 (Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 (Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 (Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 (Timeout)
18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:57 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 (Timeout)
18:00:58 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
18:00:58 poll([{fd=14, events=POLLIN}, {fd=16, events=POLLIN}], 2, 100) = 0 (Timeout)
--8<---------------cut here---------------end--------------->8---

This comes from ‘avahi-browse-service-thread’ in (guix avahi) and its
100ms #:timeout.

How about the change below?

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/guix/avahi.scm b/guix/avahi.scm
index aa90a5cdd4..132e42f268 100644
--- a/guix/avahi.scm
+++ b/guix/avahi.scm
@@ -89,13 +89,19 @@ when STOP-LOOP? procedure returns true."
     (close-port socket)
     ip))
 
+(define never
+  ;; Never true.
+  (const #f))
+
 (define* (avahi-browse-service-thread proc
                                       #:key
                                       types
                                       (ignore-local? #t)
                                       (family AF_INET)
-                                      (stop-loop? (const #f))
-                                      (timeout 100))
+                                      (stop-loop? never)
+                                      (timeout (if (eq? stop-loop? never)
+                                                   #f
+                                                   100)))
   "Browse services which type is part of the TYPES list, using Avahi.  The
 search is restricted to services with the given FAMILY.  Each time a service
 is found or removed, PROC is called and passed as argument the corresponding
@@ -167,4 +173,6 @@ when STOP-LOOP? procedure returns true."
                               client-callback)))
     (and (client? client)
          (while (not (stop-loop?))
-           (iterate-simple-poll poll timeout)))))
+           (if timeout
+               (iterate-simple-poll poll timeout)
+               (iterate-simple-poll poll))))))

Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Sun, 20 Dec 2020 09:44:01 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Sun, 20 Dec 2020 09:44:01 GMT) Full text and rfc822 format available.

Message #10 received at 45314-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 45314-done <at> debbugs.gnu.org
Subject: Re: bug#45314: ‘guix discover’ polls
Date: Sun, 20 Dec 2020 10:43:00 +0100
Hey Ludo,

> How about the change below?

I think it looks nice! I pushed it as
f9978346e73359ac1d8b88c9ed874edc7225582b.

Thanks,

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 17 Jan 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 102 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.