about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-03 07:16:29 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-03 07:16:29 +0000
commitaa3e1126d751560e8648ebc54f22401f183f9572 (patch)
treeef0554671ef2a2a4c5dfc22250b01031a66413c8
parent5230930a798ef261a68385d9026acb81137d640f (diff)
downloadpublic-inbox-aa3e1126d751560e8648ebc54f22401f183f9572.tar.gz
It's tempting to rely on the atomicity of smaller-than-PIPE_BUF
writes, but it doesn't work if mixed with larger ones.
-rw-r--r--lib/PublicInbox/SearchIdxSkeleton.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/SearchIdxSkeleton.pm b/lib/PublicInbox/SearchIdxSkeleton.pm
index 063c83e8..506e566f 100644
--- a/lib/PublicInbox/SearchIdxSkeleton.pm
+++ b/lib/PublicInbox/SearchIdxSkeleton.pm
@@ -80,6 +80,8 @@ sub index_skeleton {
         $str = length($str) . "\n" . $str;
 
         # multiple processes write to the same pipe, so use flock
+        # We can't avoid this lock for <=PIPE_BUF writes, either,
+        # because those atomic writes can break up >PIPE_BUF ones
         $self->_lock_acquire;
         print $w $str or $err = $!;
         $self->_lock_release;