← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:publisher-drop-missing-file-warning into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:publisher-drop-missing-file-warning into launchpad:master.

Commit message:
Drop missing-file warning in Publisher._getCurrentFiles

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/435195

As part of the recent refactoring in commit 82dfb163d64512e0d95af290adbe9b7bade70709, I added a warning if an entry in an archive's Release file doesn't exist on disk.  However, this actually turns out to be routine and expected; QA testing reminded me that Release files include entries for uncompressed versions of Packages and Sources files for the benefit of clients, even though only the compressed versions exist on disk.  Launchpad scripts set up a handler that logs `WARNING` and higher log messages as OOPSes, so this warning ends up being unreasonably noisy.

Since the warning is recent and has never been deployed to production, it's safe to just drop it.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:publisher-drop-missing-file-warning into launchpad:master.
diff --git a/lib/lp/archivepublisher/publishing.py b/lib/lp/archivepublisher/publishing.py
index e6133f4..b1faa80 100644
--- a/lib/lp/archivepublisher/publishing.py
+++ b/lib/lp/archivepublisher/publishing.py
@@ -1202,17 +1202,18 @@ class Publisher:
             real_name = current_entry.get("real_name", current_entry["name"])
             real_path = os.path.join(suite_dir, real_name)
             full_path = os.path.join(self._config.distsroot, real_path)
+            # Release files include entries for uncompressed versions of
+            # Packages and Sources files (which don't exist on disk, but
+            # allow clients to check them after decompressing) as well as
+            # for the compressed versions which do exist on disk.  As a
+            # result, it's routine that `full_path` may not exist; we skip
+            # those cases silently.
             if os.path.exists(full_path):
                 current_files[path] = (
                     int(current_entry["size"]),
                     current_entry["sha256"],
                     real_path,
                 )
-            else:
-                self.log.warning(
-                    "%s contains %s, but %s does not exist!"
-                    % (release_path, path, full_path)
-                )
         return current_files
 
     def _updateByHash(self, suite, release_file_name, extra_files):