user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 05/10] t/lei-watch: avoid race between glob + readlink
  2021-08-31 11:21  5% [PATCH 00/10] lei: several bug fixes and refinements Eric Wong
@ 2021-08-31 11:21  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-08-31 11:21 UTC (permalink / raw)
  To: meta

Open file handles in lei-daemon may be unstable so we need to
account for readlink() returning undef.
---
 t/lei-watch.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/lei-watch.t b/t/lei-watch.t
index 86fa6649..a881fbb9 100644
--- a/t/lei-watch.t
+++ b/t/lei-watch.t
@@ -25,7 +25,7 @@ test_lei(sub {
 		lei_ok 'daemon-pid'; chomp(my $pid = $lei_out);
 		skip 'missing /proc/$PID/fd', 1 if !-d "/proc/$pid/fd";
 		my @ino = grep {
-			readlink($_) =~ /\binotify\b/
+			(readlink($_) // '') =~ /\binotify\b/
 		} glob("/proc/$pid/fd/*");
 		is(scalar(@ino), 1, 'only one inotify FD');
 		my $ino_fd = (split('/', $ino[0]))[-1];

^ permalink raw reply related	[relevance 7%]

* [PATCH 00/10] lei: several bug fixes and refinements
@ 2021-08-31 11:21  5% Eric Wong
  2021-08-31 11:21  7% ` [PATCH 05/10] t/lei-watch: avoid race between glob + readlink Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-08-31 11:21 UTC (permalink / raw)
  To: meta

Another pile of things found while working on better
synchronization.

Eric Wong (10):
  lei_mail_sync: forget_folder: simplify code
  lei prune-mail-sync: handle --all (no args)
  lei_mail_sync: simplify group2folders
  lei_mail_sync: make rename_folder more robust
  t/lei-watch: avoid race between glob + readlink
  lei note-event: always flush changes on daemon exit
  lei: refresh watches before MUA spawn for Maildir
  lei_mail_sync: set_src uses binary OIDs
  lei: fix error reporting from lei/store -> lei-daemon
  lei/store: correctly delete entries from over

 lib/PublicInbox/LEI.pm         |  4 ++++
 lib/PublicInbox/LeiMailSync.pm | 36 ++++++++++++++++++++++------------
 lib/PublicInbox/LeiStore.pm    |  8 +++++---
 lib/PublicInbox/LeiStoreErr.pm | 14 +++++++++++--
 t/lei-watch.t                  |  2 +-
 t/lei_mail_sync.t              | 15 +++++++-------
 6 files changed, 53 insertions(+), 26 deletions(-)

^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-08-31 11:21  5% [PATCH 00/10] lei: several bug fixes and refinements Eric Wong
2021-08-31 11:21  7% ` [PATCH 05/10] t/lei-watch: avoid race between glob + readlink 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).