#216 Do not call hardlink after compose
Merged 11 months ago by jkaluza. Opened 11 months ago by jkaluza.
jkaluza/odcs remove-hardlink  into  master

@@ -634,14 +634,6 @@ 


          koji_tag_cache = KojiTagCache()


-         # consolidate duplicate files in compose target dir

-         if compose and compose.reused_id is None and compose.source_type != PungiSourceType.PULP:

-             try:

-                 log.info("Running hardlink to consolidate duplicate files in compose target dir")

-                 odcs.server.utils.hardlink(conf.target_dir)

-             except Exception as ex:

-                 # not fail, just show warning message

-                 log.warn("Error while running hardlink on system: %s" % str(ex), exc_info=True)



  class ComposerThread(BackendThread):

@@ -142,21 +142,3 @@ 

              shutil.copytree(s, d, symlinks, ignore)


              shutil.copy2(s, d)



- def hardlink(dirs, verbose=False):

-     """Run hardlink to consolidates duplicate files in dirs"""

-     hardlink_exe = find_executable('hardlink')

-     if not hardlink_exe:

-         raise RuntimeError("hardlink is not available on system")


-     args = [hardlink_exe]

-     if verbose:

-         args.append('-vv')


-     if isinstance(dirs, list):

-         args.extend(dirs)

-     else:

-         args.append(dirs)


-     execute_cmd(args)

- Calling hardlink on single NFS directory from multiple backends (servers) or even threads on single backend is not working properly and the concurrent hardlink processes might conflict with each other.
- We originally added hardlink support, because we thought we won't be able to use symlinks to refer to RPM packages. But we actually use symlinks now, so the storage saved by the hardlink calls is not worth the problems we would need to solve to use it properly.

This fixes issues with "Failed to rename" error message followed by failed compose with "Directory not empty" message.

Pull-Request has been merged by jkaluza

11 months ago