We must not trigger wakeups on InboxIdle users until after we've
renamed all files into place. Otherwise, the InboxIdle caller
may just reopen the old (soon-to-be-unlinked) file.
This fixes occasional test failures in t/nntpd.t
Fixes: f977826a17f8735e ("lock: reduce inotify wakeups")
$SIG{INT} or die 'BUG: $SIG{INT} not handled';
my @old_shard;
+ my $over_chg;
while (my ($old, $newdir) = each %$tmp) {
next if $old eq ''; # no invalid paths
my $tmp_over = "$new/over.sqlite3";
$over->connect->sqlite_backup_to_file($tmp_over);
$over = undef;
- syswrite($im->{lockfh}, '.'); # trigger ->check_inodes
+ $over_chg = 1;
}
if (!defined($new)) { # culled shard
die "failed to remove $prev: $!\n";
}
}
+
+ # trigger ->check_inodes in read-only daemons
+ syswrite($im->{lockfh}, '.') if $over_chg;
+
remove_tree(@old_shard);
$tmp = undef;
if (!$opt->{-coarse_lock}) {