]> git.neil.brown.name Git - edlib.git/commitdiff
notmuch: wait for thread_p
authorNeilBrown <neil@brown.name>
Wed, 31 May 2023 08:12:43 +0000 (18:12 +1000)
committerNeilBrown <neil@brown.name>
Thu, 8 Jun 2023 10:38:57 +0000 (20:38 +1000)
I wasn't waiting for this subprocess to exit.  It would sometimes hang
around as a zombie.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/TODO.md
python/module-notmuch.py

index dada32a593bdba8ee8ea3d3cff6431675f2a35b2..b1e06c449ad2386a178645ee8fdc38c071d9433f 100644 (file)
@@ -9,7 +9,7 @@ the file.
 
 ### Trivial
 
-- [ ] self.thread_p in notmuch isn't explicitly waited for, so it
+- [X] self.thread_p in notmuch isn't explicitly waited for, so it
       can remain a zombie
 - [ ] mouse click in "56 quoted lines" put cursor on next line, not
       in the quoted region
index 37384e87938067300c5af1a41b437698cc53cd1a..ee1a50347f75bb2ff98a8789497487fa92662d06 100644 (file)
@@ -1190,7 +1190,10 @@ class notmuch_query(edlib.Doc):
                 self.thread_text += b
                 b = os.read(self.thread_p.stdout.fileno(), 4096)
         except IOError:
+            # More to be read
             return 1
+        self.thread_p.wait()
+        self.thread_p = None
         # Must have read EOF to get here.
         th = json.loads(self.thread_text.decode("utf-8","ignore"))
         self.thread_text = None