Skip to content

Commit 4294d74

Browse files
yangskyboxlabsgitster
authored andcommitted
git-p4: fix freezing while waiting for fast-import progress
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 <[email protected]> Reviewed-by: Ben Keene <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 50da1e7 commit 4294d74

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

git-p4.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,7 @@ def __init__(self):
26412641
def checkpoint(self):
26422642
self.gitStream.write("checkpoint\n\n")
26432643
self.gitStream.write("progress checkpoint\n\n")
2644+
self.gitStream.flush()
26442645
out = self.gitOutput.readline()
26452646
if self.verbose:
26462647
print("checkpoint finished: " + out)

0 commit comments

Comments
 (0)