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)