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

acquirePathLock should truncate the lock file

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      When acquiring the lock in the acquirePathLock function the lock file should be truncated (O_TRUNC).

      Without truncation a restart after an unclean shutdown (i.e. power failure or kill -9) could end up with unwanted characters in the lock file. For example if the previous pid was 12345 the contents of the file before the crash will be "12345\n". When mongod is restarted with new pid 987 the contents of the file will now be "987\n5\n".

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            sh Stephen Haynes
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: