From a2066d75f9cf46ca98d137b61789d12daef677e1 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Fri, 17 Mar 2023 17:52:04 +0545 Subject: [PATCH] add a note why we are flushing (#9205) --- dvc/daemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dvc/daemon.py b/dvc/daemon.py index 874627e43..7caf42d44 100644 --- a/dvc/daemon.py +++ b/dvc/daemon.py @@ -56,6 +56,8 @@ def _spawn_windows(cmd, env): def _spawn_posix(cmd, env): from dvc.cli import main + # `fork` will copy buffers, so we need to flush them before forking. + # Otherwise, we will get duplicated outputs. if sys.stdout and not sys.stdout.closed: sys.stdout.flush() if sys.stderr and not sys.stderr.closed: