From a8fd76ac055cb91390fb1932204e3a972e5678d5 Mon Sep 17 00:00:00 2001 From: Newnius Date: Wed, 9 Dec 2020 11:25:31 +0800 Subject: [PATCH] bugfix, make sure dfs dir is created --- agent.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agent.py b/agent.py index f361041..cc8b485 100644 --- a/agent.py +++ b/agent.py @@ -303,13 +303,17 @@ class MyHandler(BaseHTTPRequestHandler): while True: failed_cnt += 1 if failed_cnt > 3: + print("[ERROR] unable to create dfs dir %s" % dfs_src) break try: # Docker wouldn't create dir by default on bind mode, # see https://github.com/moby/moby/issues/13121 path = Path(dfs_src) path.mkdir(parents=True, exist_ok=True) - break + if path.exists(): + break + else: + time.sleep(1) except OSError as e: print("Creation of the directory %s failed" % dfs_src) print(e)