* [PATCH 2/5] spamc: retry on EINTR
2017-06-26 3:15 6% [PATCH 0/5] watch: various bugfixes and fairness improvements Eric Wong
@ 2017-06-26 3:15 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2017-06-26 3:15 UTC (permalink / raw)
To: meta
Signals can fire on us at any time if we're using blocking sysread.
---
lib/PublicInbox/Spamcheck/Spamc.pm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/Spamcheck/Spamc.pm b/lib/PublicInbox/Spamcheck/Spamc.pm
index 30eec95..ba8e44a 100644
--- a/lib/PublicInbox/Spamcheck/Spamc.pm
+++ b/lib/PublicInbox/Spamcheck/Spamc.pm
@@ -29,10 +29,14 @@ sub spamcheck {
my $buf = '';
$out = \$buf;
}
+again:
do {
$r = sysread($fh, $$out, 65536, length($$out));
} while (defined($r) && $r != 0);
- defined $r or die "read failed: $!";
+ unless (defined $r) {
+ goto again if $!{EINTR};
+ die "read failed: $!";
+ }
close $fh or die "close failed: $!";
waitpid($pid, 0);
($? || $$out eq '') ? 0 : 1;
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/5] watch: various bugfixes and fairness improvements
@ 2017-06-26 3:15 6% Eric Wong
2017-06-26 3:15 7% ` [PATCH 2/5] spamc: retry on EINTR Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2017-06-26 3:15 UTC (permalink / raw)
To: meta
A fairly large reworking of "public-inbox-watch" to improve
fairness when processing large directory scans. There are
also some minor bugfixes for signal handling.
Eric Wong (5):
watch: ensure HUP causes the scanner to be reloaded
spamc: retry on EINTR
watch: improve fairness during full rescans
watch: use "self-inotify-tempfile trick" for quit
watch: commit changes to fast-import sooner
lib/PublicInbox/Spamcheck/Spamc.pm | 6 +-
lib/PublicInbox/WatchMaildir.pm | 110 +++++++++++++++++++++++++++++--------
script/public-inbox-watch | 9 ++-
t/watch_maildir.t | 12 ++--
4 files changed, 105 insertions(+), 32 deletions(-)
--
EW
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-06-26 3:15 6% [PATCH 0/5] watch: various bugfixes and fairness improvements Eric Wong
2017-06-26 3:15 7% ` [PATCH 2/5] spamc: retry on EINTR Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).