Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-45497

QLockFile's PID clash resolution is unsuitable for long-term operations

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 RC
    • 5.1.0 , 5.4.1
    • Core: I/O
    • None
    • 80c8d324b335753d5b1758f29775b844904bb2c6

    Description

      Consider the following situation:

      • QLockFile::setStaleLockTime(0) is called for a longish operation, as recommended in the documentation.
      • QLockFile obtains a lock for the process P with PID X.
      • P crashes, and the lockfile doesn't get deleted.
      • A process Q is started and gets the PID X.
      • P is started again and tries to obtain the lock.
      • This attempt fails, because there's already a process with PID X running.

      QLockFile's attempt of resolving PID clashes revolves around the stale lock timeout. This cannot work for long-lived operations that get a zero timeout.

      QLockFile must retrieve the process name that belongs to PID X and compare it with qAppName(). If those are different, then the lock file is stale.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jbornema Joerg Bornemann
              jbornema Joerg Bornemann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes