Thread (1 message) 1 message, 1 author, 2019-12-13
DORMANTno replies REVIEWED: 1 (0M)

1 review trailer.

[PATCH v2 09/14] git-p4: fix freezing while waiting for fast-import progress

From: Yang Zhao <hidden>
Date: 2019-12-13 23:53:33
Subsystem: the rest · Maintainer: Linus Torvalds

As part of its importing process, git-p4 sends a `checkpoint` followed
immediately by `progress` to fast-import to force synchronization.
Due to buffering, it is possible for the `progress` command to not be
flushed before git-p4 begins to wait for the corresponding response.
This causes the script to freeze completely, and is consistently
observable at least on python-3.6.9.

Make sure this command sequence is completely flushed before waiting.

Signed-off-by: Yang Zhao <redacted>
Reviewed-by: Ben Keene <redacted>
---
 git-p4.py | 1 +
 1 file changed, 1 insertion(+)
diff --git a/git-p4.py b/git-p4.py
index c7170c9ae6..68f9f4fdc6 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2641,6 +2641,7 @@ def __init__(self):
     def checkpoint(self):
         self.gitStream.write("checkpoint\n\n")
         self.gitStream.write("progress checkpoint\n\n")
+        self.gitStream.flush()
         out = self.gitOutput.readline()
         if self.verbose:
             print("checkpoint finished: " + out)
-- 
2.21.0.windows.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help