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

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

XMLWordPrintable

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

      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.

        For Gerrit Dashboard: QTBUG-45497
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes