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

QNetworkDiskCache leaks file descriptors

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.2.8, 6.5.1, 6.6, 6.7, 6.8, 6.9
    • Network: Cache
    • None
    • All

    Description

      When cache files are expired, existing open file descriptors to those files are not removed, causing a leak of file descriptors.

       

      This was initially reported and fixed as QTBUG-36076, but the issue was re-introduced in QTBUG-111397. More specifically, commit e5f295c8a removes the following lines in QNetworkDiskCache::expire:

       

      -        if (cached.path.contains(PREPARED_SLASH)) {
      -            auto matchesCacheItem = [&cached](QCacheItem *item) {
      -                return item && item->file && item->file->fileName() == cached.path;
      -            };
      -            auto itemIt = std::find_if(d->inserting.cbegin(), d->inserting.cend(), matchesCacheItem);
      -            if (itemIt != d->inserting.cend()) {
      -                auto &tempfile = (*itemIt)->file;
      -                delete tempfile;
      -                tempfile = nullptr;
      -            }
      -        } 

       

       

      which were responsible for avoiding the leak.

      Attachments

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

        Activity

          People

            manordheim Mårten Nordheim
            bclement Basile Clement
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes