Skip to content

Tolerate EEXIST in make_ancestors()#378

Open
rdjjke wants to merge 1 commit into
NVIDIA:mainfrom
rdjjke:main
Open

Tolerate EEXIST in make_ancestors()#378
rdjjke wants to merge 1 commit into
NVIDIA:mainfrom
rdjjke:main

Conversation

@rdjjke

@rdjjke rdjjke commented Jul 8, 2026

Copy link
Copy Markdown

Now, the file_create function (used to create destination placeholders for bind-mounts) doesn't fail if any target file already exists, which can happen if nvidia-container-cli configure runs concurrently for the same path. However, the creation of the parent directories is not equally race-tolerant.

make_ancestors checks whether each directory exists before calling mkdir. If another process creates the directory in the window between that check and the mkdir, the mkdir fails with EEXIST and aborts the whole nvidia-container-cli configure.

This PR contains a small patch to tolerate EEXIST in make_ancestors, matching the idiom already used for the final mkdir/symlink in file_create.

Signed-off-by: Mikhail Mokrushin <rodrijjke@nebius.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant