Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-57378

Fix data-race in the resharding commit monitor unit-tests

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v5.0
    • Sprint:
      Sharding 2021-06-14
    • Linked BF Score:
      33
    • Story Points:
      1

      Description

      The UnblocksWhenCancellationTokenIsCancelled test (defined here) may hang due to the following:

      • The main-thread proceeds with running commands for the mocked network interface (here), but is scheduled out after running the first command, which cancels the cancelation token.
      • The commit monitor is notified about the cancelation, by checking the cancelation token in here, and returns from the function that queries the shards. As a result, the instance of ARS goes out of scope, and the destructor for ARS cancels any pending network operations.
      • The main thread is scheduled again to run commands on behalf of the mocked network interface, but since the pending commands are canceled, it will stay blocked forever.

      The simple fix for this data-race is to create a new fail-point that blocks the commit-monitor in here, and unblocks it after canceling the cancelation token. This change obviates the need for the main thread to serve any commands for the mocked network interface.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              amirsaman.memaripour Amirsaman Memaripour
              Reporter:
              amirsaman.memaripour Amirsaman Memaripour
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: