Skip to content

Is file-locking on windows currently broken? #3284

@apostasie

Description

@apostasie

Description

I have been scratching my head over suspicious CI failures that only affect Windows and that definitely involves volumes (hence file locking).

Closely reading source code, it looks like the behavior on unix is to lock exclusively:

https://github.com/containerd/nerdctl/blob/main/pkg/lockutil/lockutil_unix.go#L62

While on windows:

https://github.com/containerd/nerdctl/blob/main/pkg/lockutil/lockutil_windows.go#L54

We do not seem to request an exclusive lock (which would be LOCKFILE_EXCLUSIVE_LOCK = 2).

I will submit a PR now as this seems wrong - but I would like a confirmation from someone, as windows is not really my jam.

@AkihiroSuda opinion?

Steps to reproduce the issue

na

Describe the results you received and expected

na

What version of nerdctl are you using?

na

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions