Authentication-Results: mail-b.sr.ht; dkim=pass header.d=emersion.fr header.i=@emersion.fr Received: from mail-4022.proton.ch (mail-4022.proton.ch [185.70.40.22]) by mail-b.sr.ht (Postfix) with ESMTPS id F3D4C11EF7F for <~emersion/hut-dev@lists.sr.ht>; Mon, 27 Jun 2022 13:04:00 +0000 (UTC) Date: Mon, 27 Jun 2022 13:03:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail2; t=1656335039; x=1656594239; bh=xH1UYW77jnFmnSBHPA4P37gxYIc6l7Hoo2A3DAU/SX4=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=Kjck7oF3OIteXhPA9e/PXrD5Q9FsSo3D3CKAMbOrxk0268OWrTTzrpuA3HNfqp52P 5LfXLs1BZUtCqAuI2o+8z323N0lQ14br62RDpcegPWu2zY1dOb/AyYq/epIpL4aRCN U/M6c6+p2fnNMWkr97idDz5MoHmPcZxSb+XPc7rM/N2Zqn8J6eGHKBksqZo9q7dLWM iVBTIYoe+JLa05mdxANSrhkelGuhNMYhXNsN2f1dlKXcgEwccdE+O6/Jdq6FiHM3yu NA8duCBUU3a00Wu83DMPSsVdvnsjlDtkCmStg4pVQiyfZa/i/Zh3igh0YekL3YgIN7 92e5HmO/vHXxQ== To: blallo@autistici.org From: Simon Ser Cc: ~emersion/hut-dev@lists.sr.ht Reply-To: Simon Ser Subject: Re: [PATCH] Make timeout configurable Message-ID: In-Reply-To: <20220626081614.q6basbarqr2qpjxf@rita> References: <20220516150540.42563-1-blallo@autistici.org> <3JNzmIMfnnIA2cTXpbkaMFRkxng1BQv1Luatof43V25F4MpgSFS_k5E9zFm7WPdpnR0DasSRPKgS3dAr1w5iodrZTsc8UvEifatPy6ImF6Y=@emersion.fr> <20220626081614.q6basbarqr2qpjxf@rita> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sunday, June 26th, 2022 at 10:16, wrote: > Simon Ser: > > > On Monday, May 16th, 2022 at 17:02, Blallo blallo@autistici.org wrote: > > > > > The http client used for interacting with the hut instance had a > > > hardcoded 30 seconds timeout. While this might be ok in most cases, I > > > happened to hit one of the corner cases when trying to push a tarball= to > > > site.ht. This commit adds a global flag to set the value, defaulting = to > > > the old one. > > > > Hm. If possible, I'd prefer to do the right thing by default and set a > > longer timeout for queries involving large file uploads, without > > requiring the user to manually pass a --timeout option. > > (Sorry for the late reply). I understand that it would be a great > improvement from the user experience perspective, but it is a bit > cumbersome to implement. I have two approaches in mind: > - Let the client compute the size of the objects it wants to push to > the remote This input file may come from stdin, in which case it's not possible to compute the size. > - Let the client use retries with "exponential" timeout increase > (like, first timeout 30s, then 60s, then a last try with 120s?) > > Both approaches have drawbacks: in the first case either we have to > specify a body size (that we have to compute) for each call or consume > the io.Reader passed to the client before submitting the true > request; in the second case, the worst case has the user waiting for > 30+60+120 =3D 210 seconds. > > I prefer the first approach, but I want your opinion before trying to > do that. Can't we just use a fixed timeout of e.g. 5min, just for this command?