Core Server
  1. Core Server
  2. SERVER-3582

Mongo Windows Service locks up CPU when computer reboots after a crash.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major - P3 Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.8.2
    • Fix Version/s: 2.1.0
    • Component/s: Internal Code
    • Labels:
    • Environment:
      Windows 7 64 bit, Mongo 64 bit
    • Operating System:
      Windows
    • Bug Type:
      Logical
    • # Replies:
      5
    • Last comment by Customer:
      true

      Description

      I have MongoDB set up as a Windows Service. If Windows crashes, MongoDB has a lock file in the data directory that causes the server to use 100% CPU and write continuously to the log file. This happens even if Mongo was never used. Currently the only solution is to disable the service and delete the lock file.

      1. log
        7 kB
        Ian Campbell
      2. mongod.lock
        0.0 kB
        Ian Campbell

        Issue Links

          Activity

          Hide
          Chris Westin
          added a comment -

          Do you still have the log file? It might be helpful to see what mongod is writing, even just the tail end of it, if you have it. If you do, please attach it here.

          Show
          Chris Westin
          added a comment - Do you still have the log file? It might be helpful to see what mongod is writing, even just the tail end of it, if you have it. If you do, please attach it here.
          Hide
          Ian Campbell
          added a comment -

          The tail end of the log file + the lock file. You can see the server infinitely keeps restarting.

          Show
          Ian Campbell
          added a comment - The tail end of the log file + the lock file. You can see the server infinitely keeps restarting.
          Hide
          auto
          added a comment -

          Author:

          {u'login': u'', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

          Message: SERVER-3582 – Mongo Windows Service locks up CPU when computer reboots after a crash

          Remove (put on the wrong side of #if 1, actually) the code that was setting
          up automatic restarts (forever) after a "failure". Anything other than a
          clean exit would cause automatic restart, and anything other than a clean
          exit would leave the mongod.lock file set, which would cause another failure.
          We need to have a better scheme for having the Windows service "do the right
          thing" after a power failure or system crash, looping forever in failure mode
          is not good behavior.
          Branch: master
          https://github.com/mongodb/mongo/commit/03cfbb50629b32c58db1cfef7e9e08e30d0c9fe6

          Show
          auto
          added a comment - Author: {u'login': u'', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'} Message: SERVER-3582 – Mongo Windows Service locks up CPU when computer reboots after a crash Remove (put on the wrong side of #if 1, actually) the code that was setting up automatic restarts (forever) after a "failure". Anything other than a clean exit would cause automatic restart, and anything other than a clean exit would leave the mongod.lock file set, which would cause another failure. We need to have a better scheme for having the Windows service "do the right thing" after a power failure or system crash, looping forever in failure mode is not good behavior. Branch: master https://github.com/mongodb/mongo/commit/03cfbb50629b32c58db1cfef7e9e08e30d0c9fe6
          Hide
          Tad Marshall
          added a comment -

          Fixed by commit 03cfbb50629b32c58db1cfef7e9e08e30d0c9fe6 .
          We were setting the MongoDB Windows service to auto-restart, but this is doomed to failure after a crash because the mongod.lock file will cause us to fail on restart, leading to an endless loop.
          We need to have a better solution to this, so that we restart in recovery mode or notify an administrator of the need for manual intervention somehow. I'll post a separate bug asking for that.

          Show
          Tad Marshall
          added a comment - Fixed by commit 03cfbb50629b32c58db1cfef7e9e08e30d0c9fe6 . We were setting the MongoDB Windows service to auto-restart, but this is doomed to failure after a crash because the mongod.lock file will cause us to fail on restart, leading to an endless loop. We need to have a better solution to this, so that we restart in recovery mode or notify an administrator of the need for manual intervention somehow. I'll post a separate bug asking for that.
          Hide
          Tad Marshall
          added a comment -

          I posted bug SERVER-4373 – Windows service should "do the right thing" after a crash – to address the need to recover better after a system crash.

          Show
          Tad Marshall
          added a comment - I posted bug SERVER-4373 – Windows service should "do the right thing" after a crash – to address the need to recover better after a system crash.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                2 years, 21 weeks, 4 days ago
                Date of 1st Reply: