FFFF Nightly NFS lock-suite failure · Issue #334 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

Nightly NFS lock-suite failure #334

Closed

Description

@github-actions

The nightly NFS lock suite failed.

Test output

�[1m�[33mwarning�[0m: Cargo.toml: `panic` setting is ignored for `bench` profile
�[1m�[33mwarning�[0m: `minigraf` (manifest) generated 1 warning
�[1m�[92m   Compiling�[0m minigraf v1.2.3 (/home/runner/work/minigraf/minigraf)
�[1m�[92m    Finished�[0m `test` profile [unoptimized + debuginfo] target(s) in 0.25s
�[1m�[92m     Running�[0m tests/nfs_lock_test.rs (target/debug/deps/nfs_lock_test-6e8cc48881198bda)

running 5 tests
OPEN_OK
test test_open_unlocked_mode_succeeds_on_an_ordinary_filesystem ... ok
test test_unrecognized_mode_fails_loudly_instead_of_falling_through ... ok

thread 'test_allow_unlocked_gates_the_unsupported_nfsv3_mount' (5640) panicked at tests/nfs_lock_test.rs:188:5:
default open must fail closed on a mount that cannot lock.
stdout: OPEN_OK

stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/std/src/panicking.rs:679:5
   1: core::panicking::panic_fmt
             at /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/panicking.rs:80:14
   2: nfs_lock_test::test_allow_unlocked_gates_the_unsupported_nfsv3_mount
             at ./tests/nfs_lock_test.rs:188:5
   3: nfs_lock_test::test_allow_unlocked_gates_the_unsupported_nfsv3_mount::{closure#0}
             at ./tests/nfs_lock_test.rs:176:59
   4: <nfs_lock_test::test_allow_unlocked_gates_the_unsupported_nfsv3_mount::{closure#0} as core::ops::function::FnOnce<()>>::call_once
             at /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/ops/function.rs:250:5
   5: <fn() -> core::result::Result<(), alloc::string::String> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/88d9e12ae178fab0fb5cc050a94da85685d449ea/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test test_allow_unlocked_gates_the_unsupported_nfsv3_mount ... FAILED
test test_lock_is_exclusive_or_refused_over_nfsv3_without_lockd ... ok
OPEN_OK
test test_lock_is_exclusive_over_nfsv4 ... ok

failures:

failures:
    test_allow_unlocked_gates_the_unsupported_nfsv3_mount

test result: FAILED. 4 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 27.22s

�[1m�[91merror�[0m: test failed, to rerun pass `--test nfs_lock_test`

Activity

  1. adityamukho commented on Aug 23, 2026

    @adityamukho
    Collaborator

    Diagnosis

    This is not a test-infrastructure bug — it's the nightly NFS suite catching the exact risk flagged as unmitigated on merge in the kernel file-locking design doc's risk table (docs/superpowers/specs/2026-08-22-kernel-file-locking-design.md):

    if flock silently no-ops on some network filesystem, two processes both receive Ok(()) and both write... it is not an error we can catch.

    What happened: On the loopback NFSv3 mount with nolock, std::fs::File::try_lock() returns Ok(()), not an error. Linux's NFS client handles flock() on a nolock mount via local, in-kernel advisory locking rather than going over NLM to the server — so classify() (src/storage/backend/file.rs) takes the Acquired branch, never Unsupported. allow_unlocked is never consulted, because the code never learns the mount can't really lock.

    Why the exclusivity tests still passed: this suite runs both processes from the same client machine, so the local kernel lock table still serializes them correctly within that host. The real-world danger is two separate client machines mounting the same nolock export — each gets its own Ok(()) from its own local kernel, with zero cross-host coordination. A single-runner loopback test structurally cannot reproduce that (would need a second physical/VM client), but this result confirms the mechanism the design doc worried about is real.

    Scope note

    Issue #324 (this workflow) was scoped to building the detection infrastructure, not fixing lock detection logic — so this failure is expected to stay open until a follow-up addresses it, rather than something #324's own PR should have silently patched around. test_allow_unlocked_gates_the_unsupported_nfsv3_mount's premise (that an unsupported mount produces an I/O error) doesn't hold for nolock specifically; it's accurate for genuinely lock-incapable filesystems (e.g. some FUSE/9p mounts), just not this one.

    Possible directions for a fix

    • Detect nolock-style local-only NFS locking some other way (e.g. probe via a second, real network round-trip rather than trusting try_lock()'s local success) — nontrivial, std doesn't expose enough here.
    • Document the nolock case explicitly as an unsupported deployment (like unmixed-version writers already are) rather than trying to detect it in-process.
    • Multi-client NFS testing in CI (a second real host/VM) to actually exercise the cross-host silent-no-op, if the above local reproduction isn't considered sufficient evidence on its own.

    No code change proposed here yet — flagging for design discussion before picking a direction.

  2. adityamukho commented on Aug 23, 2026

    @adityamukho
    Collaborator

    Fixed in #335 (merged 47f3e54): documented the nolock gap as an unsupported deployment rather than patching classify() (no way to detect it from try_lock's result). Test premise corrected, doc-comment added on LockOutcome::Unsupported, operator-facing writeup in ERROR_REFERENCE.md STG-027 and CHANGELOG, and the nightly workflow no longer provisions the nolock mount since there's nothing for it to gate on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0