Skip to content

Windows: the withdrawal of a discovery record can fail while a reader holds it, leaving a dead session listed #506

Closed

Description

@ambroise-leclerc

discovery::Registration::remove() ignores the error of std::filesystem::remove. On Windows a reader that has the record open (discovery::list reads it with std::ifstream, which does not share deletion) makes the removal fail with a sharing violation, and nothing retries: the record stays listed while its process is alive.

Observed intermittently in CI on desktop-native (windows-msvc-webview2): the scenario "A window that ignores the deadline's close request is declared unresponsive by the consumer's automation" (test/unit/AutomationDiscoveryTests.cpp, added by #501) fails on REQUIRE(eventually([&] { return discovery::list(sessions).empty(); })), which polls list() every 10 ms while the controller removes the record from another thread. It failed on develop (run 42609482904, merge of #502) and on the PR #503 run 42611883578, and passed when that job was rerun.

Expected: a withdrawn session disappears from the listing even when it is being read concurrently.

Follow-up of #501. Fix proposed in #505.

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