From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id qEnOCO36aGXt9wAAG6o9tA:P1 (envelope-from ) for ; Thu, 30 Nov 2023 22:13:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qEnOCO36aGXt9wAAG6o9tA (envelope-from ) for ; Thu, 30 Nov 2023 22:13:17 +0100 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 C417A5668C for ; Thu, 30 Nov 2023 22:13:16 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=NUqzW8as; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701378797; a=rsa-sha256; cv=none; b=VUBxR4/lkAkmixQLlvvYNQjg2rqh9ENBq5gYI0a9iiVzCp+/LH28OAWALcQ2j+X69KB6f9 PgA+yJd8rCvkWKfvWMuOSu1ZIwrhUmfMZZlUQ2tn7VQsNSHhCMpOWmo5EHpUE98vT2P5Hp XEno8XWMvL+nVYGPIb+wav7anLWZRm6/4jjOdkIEl8oX2idnY9AOjF3vdsnQsebhE7/7LL 9qaXtc5iWzzEvtOB8C6S8v4NB+v3Q2h09qx9NyDGYUX7Fk6JaJY8j70fA6mKC/mMIDmEw9 sBnl2qJycNZtp50h3PB8vBa1yKsTg5crUV3NiQ4sVsMg88Ap66tnxlIgf4noYA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=NUqzW8as; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701378797; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=PKvLPR2496liOOQRwxJvgMWip5X5grNXFdZ+HJBYBsQ=; b=CPsqXpEy/rk/F7U92wypCt+lJfU8gkCJDwi1K9+e4TsIa8SidgbXxjdtAvFAEmcPzF8iGj sF5ChnChh4xBR93Y/haxd+WT42GM/OtYPL+2xatmwXBCybFnVWSotTGg6ic+BS3z4I7R0E xSUGxi0SizBq/hmAdxt/vlqpixALoEQhp37AXfXGTrFTkYF6kcNb+TQLVKjArbH3V/EorJ kOctb9Y64JfByQ/GRNbUFEqk/pap3YR18me3y11zT9l5kodVOoO8Rd/a/x3sAGQEwXFg9y G1QxyM1IhEgeUd/KzKlzUnlqRtlUGUnXlAIWpOzDoUsRwCaqVd6zyBzLNsqF3Q== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8oLA-0004u0-Nh; Thu, 30 Nov 2023 16:12:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r8oL8-0004n8-A9 for guix-patches@gnu.org; Thu, 30 Nov 2023 16:12:54 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r8oL8-00056K-1j for guix-patches@gnu.org; Thu, 30 Nov 2023 16:12:54 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r8oLF-0002le-UJ for guix-patches@gnu.org; Thu, 30 Nov 2023 16:13:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67245] [PATCH] store: Use a non-blocking socket for store connections. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Nov 2023 21:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67245 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 67245@debbugs.gnu.org Received: via spool by 67245-submit@debbugs.gnu.org id=B67245.170137873810570 (code B ref 67245); Thu, 30 Nov 2023 21:13:01 +0000 Received: (at 67245) by debbugs.gnu.org; 30 Nov 2023 21:12:18 +0000 Received: from localhost ([127.0.0.1]:54580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8oKX-0002kQ-Ma for submit@debbugs.gnu.org; Thu, 30 Nov 2023 16:12:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8oKV-0002k7-6P for 67245@debbugs.gnu.org; Thu, 30 Nov 2023 16:12:16 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r8oKH-00054J-Hg; Thu, 30 Nov 2023 16:12:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=PKvLPR2496liOOQRwxJvgMWip5X5grNXFdZ+HJBYBsQ=; b=NUqzW8asuniYuolnnjwG 3MEEv48gWh9wy2ESNXzFajjKu3F9J7WQSjaIVhrRdIsdRlknSEf9VracNOBf+SeL20gP86nxv7uyC 3bEi/Na5gZ+vc1HbYUF4AZWoZlGlm7OVtLRAjWRVo0BXPlRP8zG6pa8wGIW1NIwccUTAqYyvi9NU3 yBkWOQY7BL2KIKt0Q8U9zO3Mn1xg41VAwJ0iezsrZjq4qwsDR2dLq+ZVNSHcMhmSiH4Marz5BR3d7 quygTJSCLLZdu6XVvkZIwidklyMoznud/rDlSCPcvGyVU/durZZy3tffq1dU8LptA9NZx0tlTaM4f RHsuG94FR5rfgw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <875y1nmrwf.fsf@cbaines.net> (Christopher Baines's message of "Mon, 27 Nov 2023 09:48:09 +0000") References: <460cdfa67b473ea2f1593668b2d9d0fd159378d0.1700244314.git.mail@cbaines.net> <87fs0s17op.fsf@gnu.org> <875y1nmrwf.fsf@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?UTF-8?Q?D=C3=A9cadi?= 10 Frimaire an 232 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Pioche 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: Thu, 30 Nov 2023 22:11:58 +0100 Message-ID: <87fs0nndy9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -6.82 X-Spam-Score: -6.82 X-Migadu-Queue-Id: C417A5668C X-TUID: 9WMu/T3V67DH Hi Chris, Christopher Baines skribis: > Ludovic Court=C3=A8s writes: >> I feel we should really discuss on Guix + Fibers since we=E2=80=99ve app= arently >> been going through the exact same set of issues. :-) >> >> (The other thing that comes to mind is the resource pool!) > > I'm mostly ignoring these issues then coping the code once you write it > :) Heh, so we=E2=80=99re already in sync maybe, not bad. :-) >>> +++ b/guix/store.scm >>> @@ -460,7 +460,9 @@ (define (open-unix-domain-socket file) >>> '&store-connection-error' upon error." >>> (let ((s (with-fluids ((%default-port-encoding #f)) >>> ;; This trick allows use of the `scm_c_read' optimization. >>> - (socket PF_UNIX (logior SOCK_STREAM SOCK_CLOEXEC) 0))) >>> + (socket PF_UNIX >>> + (logior SOCK_STREAM SOCK_CLOEXEC SOCK_NONBLOCK) >>> + 0))) >> >> We cannot do this here because callers have to be prepared to deal with >> non-blocking sockets, and that=E2=80=99s not the case in Guix itself. > > I can see potential problems for programs outside of Guix which use > suspendable ports, but given Guix doesn't use suspendable ports, this > won't change behaviour, right? > > Obviously Guile will be working a bit differently, using poll when it > needs to wait for I/O, but at the scheme level within Guix, things > should be no different. Hmm yes, I think you=E2=80=99re right. One issue is if we hand over the file descriptor to something that=E2=80=99= s not Guile. Off the top of my head, this happens with inferiors and in the =E2=80=98build=E2=80=99 procedure of =E2=80=98build-self.scm=E2=80=99 (well= , the process that receives that file descriptor is Guile, but if it=E2=80=99s older than 3.0 (?), then= it may behave differently.) So it should be safe indeed, but adds a bit of overhead (hopping via =E2=80=98current-{read,write}-waiter=E2=80=99) and needs good testing. Laziness gives an incentive for the status quo, but I=E2=80=99m not opposed= to the change if we get more confidence (test suite passing, tests with inferiors and =E2=80=98time-machine=E2=80=99, and some more auditing.) Ludo=E2=80=99.