Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky test shutdown race in seqno_time_test #12282

Closed

Commits on Jan 23, 2024

  1. Fix flaky test shutdown race in seqno_time_test

    Summary: Seen in build-macos-cmake:
    
    ```
    Received signal 11 (Segmentation fault: 11)
    	facebook#1   rocksdb::MockSystemClock::InstallTimedWaitFixCallback()::$_0::operator()(void*) const (in seqno_time_test) (mock_time_env.cc:29)
    	facebook#2   decltype(std::declval<rocksdb::MockSystemClock::InstallTimedWaitFixCallback()::$_0&>()(std::declval<void*>())) std::__1::__invoke[abi:v15006]<rocksdb::MockSystemClock::InstallTimedWaitFixCallback()::$_0&, void*>(rocksdb::MockSystemClock::InstallTimedWait	ixCallback()::$_0&, void*&&) (in seqno_time_test) (invoke.h:394)
    ...
    ```
    
    This is presumably because the std::function from the lambda only saves
    a copy of the SeqnoTimeTest* this pointer, which doesn't prevent it from
    being reclaimed on parallel shutdown. If we instead save a copy of the
    `std::shared_ptr<MockSystemClock>` in the std::function, this should
    prevent the crash. (Note that in `SyncPoint::Data::Process()` copies the
    std::function before releasing the mutex for calling the callback.)
    
    Test Plan: watch CI
    pdillinger committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    7195183 View commit details
    Browse the repository at this point in the history