l.a.d._diskpool_atomicfile : class documentation

Part of lp.archivepublisher.diskpool View In Hierarchy

Simple file-like object used by the pool to atomically move into place a file after downloading from the librarian.

This class is designed to solve a very specific problem encountered in the publisher. Namely that should the publisher crash during the process of publishing a file to the pool, an empty or incomplete file would be present in the pool. Its mere presence would fool the publisher into believing it had already downloaded that file to the pool, resulting in failures in the apt-ftparchive stage.

By performing a rename() when the file is guaranteed to have been fully written to disk (after the fd.close()) we can be sure that if the filename is present in the pool, it is definitely complete.

Method __init__ Undocumented
Method close Make the atomic move into place having closed the temp file.
def __init__(self, targetfilename, mode, rootpath='/tmp'):
Undocumented
def close(self):
Make the atomic move into place having closed the temp file.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.