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

Do not abort server when receiving multiple SIGUSR1 in the same second

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.4.4, 3.5.2
    • Affects Version/s: 2.6.4
    • Component/s: Logging
    • None
    • Fully Compatible
    • v3.4
    • Platforms 2017-01-23, Platforms 2017-02-13

      Server crashes if logRotate destination file already exists after receiving a SIGUSR1.
      For example if SIGUSR1 is sent twice during the same second the destination file will be the same and the server will crash.

      Affected version:

      2015-01-13T13:54:10.021+0000 [signalProcessingThread] db version v2.6.4
      2015-01-13T13:54:10.021+0000 [signalProcessingThread] git version: 3a830be0eb92d772aa855ebb711ac91d658ee910
      2015-01-13T13:54:10.021+0000 [signalProcessingThread] build info: Linux build7.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49

      The reported error is:

      015-01-13T13:54:10.766+0000 [signalProcessingThread] warning: Rotating log file /data/log/mongodb/mongodb.log failed: FileRenameFailed Renaming file /data/log/mongodb/mongodb.log to /data/log/mongodb/mongodb.log.2015-01-13T13-54-10 failed; destination already exists
      2015-01-13T13:54:10.766+0000 [signalProcessingThread] Fatal Assertion 16782
      2015-01-13T13:54:10.769+0000 [signalProcessingThread] 0x11e6111 0x1187e49 0x116a97d 0x11e57cf 0x122aaa9 0x7fe544cbd182 0x7fe543fc238d
      /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x11e6111]
      /usr/bin/mongod(_ZN5mongo10logContextEPKc+0x159) [0x1187e49]
      /usr/bin/mongod(_ZN5mongo13fassertFailedEi+0xcd) [0x116a97d]
      /usr/bin/mongod() [0x11e57cf]
      /usr/bin/mongod() [0x122aaa9]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x8182) [0x7fe544cbd182]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fe543fc238d]
      2015-01-13T13:54:10.769+0000 [signalProcessingThread]

      ***aborting after fassert() failure

      2015-01-13T13:54:10.772+0000 [signalProcessingThread] SEVERE: Got signal: 6 (Aborted).
      Backtrace:0x11e6111 0x11e54ee 0x7fe543efe000 0x7fe543efdf89 0x7fe543f01398 0x116a9ea 0x11e57cf 0x122aaa9 0x7fe544cbd182 0x7fe543fc238d
      /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x11e6111]
      /usr/bin/mongod() [0x11e54ee]
      /lib/x86_64-linux-gnu/libc.so.6(+0x37000) [0x7fe543efe000]
      /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7fe543efdf89]
      /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fe543f01398]
      /usr/bin/mongod(_ZN5mongo13fassertFailedEi+0x13a) [0x116a9ea]
      /usr/bin/mongod() [0x11e57cf]
      /usr/bin/mongod() [0x122aaa9]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x8182) [0x7fe544cbd182]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fe543fc238d]

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            volans Volans
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: