unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] xt/mem-imapd-tls: avoid EMFILE in -imapd process
@ 2020-07-13  2:23 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2020-07-13  2:23 UTC (permalink / raw)
  To: meta

Test::More dups standard FDs and may create FDs for other
purposes.  run_mode => 0 lets us rely on FD_CLOEXEC to ensure
-imapd has enough FDs to accept all incoming connections at
the cost of higher (one-off) startup time.
---
 xt/mem-imapd-tls.t | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xt/mem-imapd-tls.t b/xt/mem-imapd-tls.t
index 660fdc77..3f1436c7 100644
--- a/xt/mem-imapd-tls.t
+++ b/xt/mem-imapd-tls.t
@@ -49,7 +49,9 @@ my $imaps_addr = $imaps->sockhost . ':' . $imaps->sockport;
 my $env = { PI_CONFIG => $pi_config };
 my $arg = $TEST_TLS ? [ "-limaps://$imaps_addr/?cert=$cert,key=$key" ] : [];
 my $cmd = [ '-imapd', '-W0', @$arg, "--stdout=$out", "--stderr=$err" ];
-my $td = start_script($cmd, $env, { 3 => $imaps });
+
+# run_mode=0 ensures Test::More FDs don't get shared
+my $td = start_script($cmd, $env, { 3 => $imaps, run_mode => 0 });
 my %ssl_opt;
 if ($TEST_TLS) {
 	%ssl_opt = (

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-13  2:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13  2:23 [PATCH] xt/mem-imapd-tls: avoid EMFILE in -imapd process Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).