Skip to content

Do not block try lock on state mutex#479

Merged
Luap99 merged 1 commit into
podman-container-tools:mainfrom
koct9i:fix-try-lock-state
Nov 26, 2025
Merged

Do not block try lock on state mutex#479
Luap99 merged 1 commit into
podman-container-tools:mainfrom
koct9i:fix-try-lock-state

Conversation

@koct9i

@koct9i koct9i commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

TryLock should not block when file lock is held by other process and
state lock is held by other coroutine which waits for file lock.

Signed-off-by: Konstantin Khlebnikov koct9i@gmail.com

@github-actions github-actions Bot added the storage Related to "storage" package label Nov 19, 2025
@koct9i koct9i marked this pull request as ready for review November 19, 2025 18:51
@koct9i koct9i force-pushed the fix-try-lock-state branch from fc40727 to 6c1f323 Compare November 19, 2025 18:55
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Nov 19, 2025
@podmanbot

Copy link
Copy Markdown

✅ A new PR has been created in buildah to vendor these changes: podman-container-tools/buildah#6513

@mtrmac mtrmac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The PR looks correct, but this is critical code, so I’d like more independent, careful, reviewers. @Luap99 @giuseppe PTAL.


Though, I must ask: AFAICS these functions have no callers within the primary users of this library (… any more, at least). Where did this show up as a problem?

Comment thread storage/pkg/lockfile/lockfile.go
TryLock should not block when file lock is held by other process and
state lock is held by other coroutine which waits for file lock.

Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
@koct9i

koct9i commented Nov 26, 2025

Copy link
Copy Markdown
Contributor Author

Where did this show up as a problem?

Currently I'm looking into image storage performance and parallelism.
I've found this at first glance at the code.

@koct9i koct9i force-pushed the fix-try-lock-state branch from 6c1f323 to 0b25f83 Compare November 26, 2025 11:33
podmanbot pushed a commit to podmanbot/buildah that referenced this pull request Nov 26, 2025

@giuseppe giuseppe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Luap99 Luap99 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Luap99 Luap99 merged commit 4fc82df into podman-container-tools:main Nov 26, 2025
38 checks passed
@koct9i koct9i deleted the fix-try-lock-state branch November 29, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

storage Related to "storage" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants