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

Make FailPoint::pauseWhileSet increment _timesEntered once

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.3, 4.3.3
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • ALL
    • v4.2
    • Sharding 2019-12-02, Sharding 2019-12-16

      SERVER-44666 was done with the misconception that calling pauseWhileSet should not count as entering a fail point because this pattern shows up widely in the codebase:

       

      if (failPoint.shouldFail()) {    
       LOG(0) << "log line that used to be used for checkLog";     
       failPoint.pauseWhileSet(); 
      }

       

      However, the intended use of the function is for entering and waiting for a fail point to be disabled. Therefore, it should be made to increment _timesEntered once. Also, the tests that wait for additional times entered > 1 should be reverted to use checkLog.

      Note: I also discovered that there is code all over that uses combinations of shouldFail, pauseWhileSet, executeIf, and execute when entering a fail point. This implies that prior to SERVER-44666 and even SERVER-39165, for the fail points that are entered that way, the times and skip mode in the configureFailPoint command did not have the correct behavior because we always overcounted the number of times entered and returned early. 
       
       

            Assignee:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: