@matheusbsbs / matheus-bagliano / commits / 4294d741cc
Fork 0

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 <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Yang Zhao committed Dec 13, 2019 at 15:52 UTC 4294d741cc13e1f5533efaa693e4479c62b28873
1 file changed +1
git-p4.py
+1
@@ -2641,6 +2641,7 @@ class P4Sync(Command, P4UserMap):
2641 def checkpoint(self):
2642 self.gitStream.write("checkpoint\n\n")
2643 self.gitStream.write("progress checkpoint\n\n")
2644 + self.gitStream.flush()
2645 out = self.gitOutput.readline()
2646 if self.verbose:
2647 print("checkpoint finished: " + out)