8000 Flaky: field_expiry_ms dump/restore/migrate test reads a field deadline back up to 2 ms late under load · Issue #494 · kividbio/kividb · GitHub
[go: up one dir, main page]

Skip to content

Flaky: field_expiry_ms dump/restore/migrate test reads a field deadline back up to 2 ms late under load #494

Open

Description

@murtazayusuf

tests/field_expiry_ms.rs a_field_deadline_is_kept_to_the_millisecond_by_dump_restore_and_migrate failed once in a full parallel cargo test --features lua,tls run on an Azure D16ps_v5. That was during the #490 trials, but the code involved isn't changed by #490. After MIGRATE, 1 of 900 field deadlines read back 2 ms late (h74, field a: …979 instead of …977).

Likely cause: FieldClock (src/commands/helpers.rs) reads the monotonic and wall clocks as a pair. Since #488 it rounds so that deadlines are never early, so a thread preempted between the reads makes a deadline late. Retries cap the gap at 50 µs, but the conversion happens twice (save and load), and rounding to the millisecond can turn a small gap into 1-2 ms.

Options: let the test allow a small late tolerance (never early), or carry the absolute Unix ms through DUMP/RESTORE and MIGRATE so they don't convert twice. Found during #490's trials (3 full runs; 1 failure in 1 run).

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0