From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 725731F572 for ; Fri, 26 Jul 2024 21:43:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1722030191; bh=+6s6teVaMIaSw2nUJswS0r62u0OhUcRDAuEnjbR//RA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RmRLT119Sb54eBK2dNBQeT+Oqo3ZBPIE2q/7HDiMzpcUlHC/YVoEyce5PDAnwmJmi 7DI2Wq1WEp6W5XTViXovOAH4F1D31SmgnKjkGZ8hAvpdfV9Ku+DG9ePA0pW7SkqB5c 4lIwJXyahk6LSG08BWe+9QBX9aOubqr+yMFDjKvM= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH v2 0/4] fix ENOSPC on writes Date: Fri, 26 Jul 2024 21:31:07 +0000 Message-ID: <20240726214311.4092940-1-e@80x24.org> In-Reply-To: <20240723212837.3931413-1-e@80x24.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: v2 addresses grammar nits by Štěpán. 2/4 is the actual fix to the bug reported by Robin, but the others update tests and increase coverage for integration with the v2writable code path. Eric Wong (4): t/msgmap: updates for Perl 5.12+ and copyrights msgmap: mid_insert: reraise on unexpected errors t/v2writable: test ENOSPC from fast-import t/v2writable: use 5.10.1 and autodie more lib/PublicInbox/Msgmap.pm | 6 +++- t/msgmap.t | 25 ++++++++++--- t/v2writable.t | 76 +++++++++++++++++++++++++++++++-------- 3 files changed, 86 insertions(+), 21 deletions(-) Range-diff against v1: -: -------- > 1: c72c8a39 t/msgmap: updates for Perl 5.12+ and copyrights 1: f1a53f30 ! 2: c4ca4d41 msgmap: mid_insert: reraise on unexpected errors @@ t/msgmap.t: is(eval { + $rd->poll_in(10) or die 'strace not ready'; + is eval { $d->mid_insert('this-better-trigger-ENOSPC@error') }, + undef, 'insert fails w/ ENOSPC'; -+ like $@, qr/ disk is full/, 'set $@ for ENOSPC'; ++ like $@, qr/ disk is full/, '$@ reports ENOSPC'; + kill 'TERM', $rd->attached_pid; + $rd->close; +} 2: 6de9c07c ! 3: 4f59948b t/v2writable: test ENOSPC from fast-import @@ t/v2writable.t: ok($@, 'V2Writable fails on non-existent dir'); '-e', 'inject=pwrite64:error=ENOSPC'], undef, { 2 => 1 }); $rd->poll_in(10) or die 'strace not ready'; - ok ! eval { $im->add($eml) }, 'v2w->add fails on ENOSPC'; +- like $@, qr/ disk is full/, 'set $@ for ENOSPC'; + ok ! eval { + open my $olderr, '>&', \*STDERR; + open STDERR, '>>', $gfi_err; + $im->add($eml); + open STDERR, '>&', $olderr; + }, 'v2w->add fails on ENOSPC'; - like $@, qr/ disk is full/, 'set $@ for ENOSPC'; ++ like $@, qr/ disk is full/, '$@ reports ENOSPC'; $im->done; kill 'TERM', $rd->attached_pid; $rd->close; @@ t/v2writable.t: ok($@, 'V2Writable fails on non-existent dir'); + + $rd->close; + -+ $im->add($eml) or xbail '->add fail after fixing ENOSPC'; ++ $im->add($eml) or xbail '->add fails after fixing ENOSPC'; + $im->done; + ok !$im->add($eml), '->add detects existing message'; + $im->done; -+ is -s $fh, 0, 'nothing new fast-import stderr'; ++ is -s $fh, 0, 'nothing new in fast-import stderr'; } done_testing; 3: f7d286d4 = 4: fba5535f t/v2writable: use 5.10.1 and autodie more