Coverity: add GUARDED_BY to BackgroundSync state

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      What

      Add `GUARDED_BY(_mutex)` to the member field in `BackgroundSync` accessed without the mutex at line 896. Add `REQUIRES(_mutex)` to the private helper that reads it.

      Files: `bgsync.cpp` (line 896).

      Resolves: SERVER-109534

      Why

      Background sync state is shared between the sync thread and control threads. Because Coverity cannot be run locally, `GUARDED_BY` is the most reliable way to confirm the fix is correct and to prevent this field from being accessed without the lock in the future.

            Assignee:
            Unassigned
            Reporter:
            Denis Trailin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: