From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iExjIr7i3F+QAQAA0tVLHw (envelope-from ) for ; Fri, 18 Dec 2020 17:11:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CLI2Hr7i3F+tEgAA1q6Kng (envelope-from ) for ; Fri, 18 Dec 2020 17:11:26 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AF2969402A5 for ; Fri, 18 Dec 2020 17:11:25 +0000 (UTC) Received: from localhost ([::1]:38370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqJHl-00054x-Pv for larch@yhetil.org; Fri, 18 Dec 2020 12:11:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqJHS-00051M-Nf for bug-guix@gnu.org; Fri, 18 Dec 2020 12:11:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56514) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqJHS-0007Yp-Dt; Fri, 18 Dec 2020 12:11:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqJHS-000782-7N; Fri, 18 Dec 2020 12:11:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#45314: =?UTF-8?Q?=E2=80=98guix_?= =?UTF-8?Q?discover=E2=80=99?= polls Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: othacehe@gnu.org, bug-guix@gnu.org Resent-Date: Fri, 18 Dec 2020 17:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45314 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 45314@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org X-Debbugs-Original-Xcc: Mathieu Othacehe Received: via spool by submit@debbugs.gnu.org id=B.160831142327349 (code B ref -1); Fri, 18 Dec 2020 17:11:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Dec 2020 17:10:23 +0000 Received: from localhost ([127.0.0.1]:39827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqJGo-000772-PH for submit@debbugs.gnu.org; Fri, 18 Dec 2020 12:10:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:58940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqJGg-00076m-2s for submit@debbugs.gnu.org; Fri, 18 Dec 2020 12:10:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqJGf-0004AH-C5 for bug-guix@gnu.org; Fri, 18 Dec 2020 12:10:13 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35914) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqJGd-00079o-VP for bug-guix@gnu.org; Fri, 18 Dec 2020 12:10:13 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=53508 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kqJGY-0002Vu-Vp for bug-guix@gnu.org; Fri, 18 Dec 2020 12:10:11 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 Frimaire an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 18 Dec 2020 18:10:04 +0100 Message-ID: <87a6ub9h1v.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Othacehe Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.82 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: AF2969402A5 X-Spam-Score: -2.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: p2WbBMkd52kq --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! =E2=80=98guix discover=E2=80=99 polls with 100ms intervals: --8<---------------cut here---------------start------------->8--- 18:00:57 poll([{fd=3D14, events=3DPOLLIN}, {fd=3D16, events=3DPOLLIN}], 2, = 100) =3D 0 (Timeout) 18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) =3D 0 18:00:57 poll([{fd=3D14, events=3DPOLLIN}, {fd=3D16, events=3DPOLLIN}], 2, = 100) =3D 0 (Timeout) 18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) =3D 0 18:00:57 poll([{fd=3D14, events=3DPOLLIN}, {fd=3D16, events=3DPOLLIN}], 2, = 100) =3D 0 (Timeout) 18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) =3D 0 18:00:57 poll([{fd=3D14, events=3DPOLLIN}, {fd=3D16, events=3DPOLLIN}], 2, = 100) =3D 0 (Timeout) 18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) =3D 0 18:00:57 poll([{fd=3D14, events=3DPOLLIN}, {fd=3D16, events=3DPOLLIN}], 2, = 100) =3D 0 (Timeout) 18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) =3D 0 18:00:57 poll([{fd=3D14, events=3DPOLLIN}, {fd=3D16, events=3DPOLLIN}], 2, = 100) =3D 0 (Timeout) 18:00:57 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) =3D 0 18:00:57 poll([{fd=3D14, events=3DPOLLIN}, {fd=3D16, events=3DPOLLIN}], 2, = 100) =3D 0 (Timeout) 18:00:58 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) =3D 0 18:00:58 poll([{fd=3D14, events=3DPOLLIN}, {fd=3D16, events=3DPOLLIN}], 2, = 100) =3D 0 (Timeout) --8<---------------cut here---------------end--------------->8--- This comes from =E2=80=98avahi-browse-service-thread=E2=80=99 in (guix avah= i) and its 100ms #:timeout. How about the change below? Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: 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)))))) --=-=-=--