From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] lei: drop -watches and -lei_note_event from workers
Date: Tue, 31 Jan 2023 00:05:15 +0000 [thread overview]
Message-ID: <20230131000515.3863177-1-e@80x24.org> (raw)
I noticed these while tracking down circular refs for commit
7b654d175cf2e31b (ipc: drop awaitpid_init to avoid circular refs, 2023-01-30).
While they're not the cause of circular refs, they're still
a waste of memory in worker processes.
---
lib/PublicInbox/LEI.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index ffd50db5..d05b20de 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -561,17 +561,17 @@ sub note_sigpipe { # triggers sigpipe_handler
sub _lei_atfork_child {
my ($self, $persist) = @_;
# we need to explicitly close things which are on stack
+ my $cfg = $self->{cfg};
if ($persist) {
open $self->{3}, '<', '/' or die "open(/) $!";
fchdir($self);
close($_) for (grep(defined, delete @$self{qw(0 1 2 sock)}));
- if (my $cfg = $self->{cfg}) {
- delete @$cfg{qw(-lei_store -watches -lei_note_event)};
- }
+ delete @$cfg{qw(-lei_store -watches -lei_note_event)};
} else { # worker, Net::NNTP (Net::Cmd) uses STDERR directly
open STDERR, '+>&='.fileno($self->{2}) or warn "open $!";
STDERR->autoflush(1);
POSIX::setpgid(0, $$) // die "setpgid(0, $$): $!";
+ delete @$cfg{qw(-watches -lei_note_event)};
}
close($_) for (grep(defined, delete @$self{qw(old_1 au_done)}));
delete $self->{-socks};
reply other threads:[~2023-01-31 0:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230131000515.3863177-1-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).