diff --git a/CHANGELOG.md b/CHANGELOG.md index 58ebd4c75..1a5d79ebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Fixes - Load CLI plug-ins in try..except block to avoid a failure in loading a plug-in to crash entire CLI ([#1392](https://github.com/neptune-ai/neptune-client/pull/1392)) +- Fixed cleaning operation storage when using sync mode and forking ([#1413](https://github.com/neptune-ai/neptune-client/pull/1413)) ## neptune 1.4.1 diff --git a/src/neptune/internal/operation_processors/sync_operation_processor.py b/src/neptune/internal/operation_processors/sync_operation_processor.py index 4cfab5507..f97243818 100644 --- a/src/neptune/internal/operation_processors/sync_operation_processor.py +++ b/src/neptune/internal/operation_processors/sync_operation_processor.py @@ -15,6 +15,7 @@ # __all__ = ("SyncOperationProcessor",) +import os from datetime import datetime from pathlib import Path from typing import Optional @@ -42,7 +43,7 @@ def __init__(self, container_id: UniqueId, container_type: ContainerType, backen def _init_data_path(container_id: UniqueId, container_type: ContainerType) -> Path: now = datetime.now() container_dir = f"{NEPTUNE_DATA_DIRECTORY}/{SYNC_DIRECTORY}/{container_type.create_dir_name(container_id)}" - data_path = f"{container_dir}/exec-{now.timestamp()}-{now.strftime('%Y-%m-%d_%H.%M.%S.%f')}" + data_path = f"{container_dir}/exec-{now.timestamp()}-{now.strftime('%Y-%m-%d_%H.%M.%S.%f')}-{os.getpid()}" return Path(data_path) def enqueue_operation(self, op: Operation, *, wait: bool) -> None: @@ -66,3 +67,6 @@ def start(self): def stop(self, seconds: Optional[float] = None): self._operation_storage.close() + + def close(self): + pass