Skip to content

fedora-pkgdb-collections: Race on fedora.json download

When the file in the cache directory does not exist yet, it is downloaded, but just when the download starts, the file monitor notices a change on the file (even it has 0 bytes in size), which causes the plugin itself emitting "updates-changed", which is caught by the Updates page and it initiated a refresh, when the current download was ongoing, which made another change on the file, which could result into a runtime warning like this one:

   updates-shell: failed to get upgrades: Failed to open file
   “~/.cache/gnome-software/fedora-pkgdb-collections/fedora.json”: open() failed:
   No such file or directory

To avoid the race, remember there is an ongoing refresh task and share the result with any new, which are initiated while the current one is running.

Merge request reports