Thanks to visit codestin.com
Credit goes to github.com

Skip to content

block: Retry locking when interrupted by EINTR - #8402

Merged
rbradford merged 1 commit into
cloud-hypervisor:mainfrom
scholzp:retry_advisary_lock_after_eintr
Jun 17, 2026
Merged

rbradford merged 1 commit into
cloud-hypervisor:mainfrom
scholzp:retry_advisary_lock_after_eintr

Conversation

@scholzp

@scholzp scholzp commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

We observed that setting image advisory locks can fail if we receive an EINTR while doing so.

We retry acquiring the lock in case of EINT to recover from it instead of aborting with an error.

Acquiring an image lock can be interrupted with EINTR. In this case, we
returned with an error. Instead, we now retry acquiring the lock.

Signed-off-by: Pascal Scholz <[email protected]>
On-behalf-of: SAP [email protected]

@phip1611 phip1611 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.

Thanks! This clearly should fix an unlikely but possible bug.

Comment thread block/src/io/fcntl.rs
// See man page for error code:
// <https://man7.org/linux/man-pages/man2/fcntl.2.html>
libc::EAGAIN | libc::EACCES => return Err(LockError::AlreadyLocked),
libc::EINTR => continue,

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.

This well matches th pattern we have also elsewhere in CH (typically with std::io::ErrorKind::Interrupted but that is because we are using higher-level libs there).

LGTM!

@scholzp
scholzp marked this pull request as ready for review June 17, 2026 08:07
@scholzp
scholzp requested a review from a team as a code owner June 17, 2026 08:07
@rbradford

Copy link
Copy Markdown
Member

Thanks!

@rbradford
rbradford added this pull request to the merge queue Jun 17, 2026
Merged via the queue into cloud-hypervisor:main with commit 257a005 Jun 17, 2026
41 checks passed
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in Cloud Hypervisor Roadmap Jul 8, 2026
@rbradford rbradford added the bug-fix Bug fix to include in release notes label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Bug fix to include in release notes

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants