#1718 also nudge reused components after 10 minutes
Merged 2 years ago by mikem. Opened 2 years ago by mikem.
mikem/fm-orchestrator missing-tags-reused-components  into  master

@@ -105,6 +105,7 @@ 

      # TODO re-use

  

      if conf.system == "koji":

+         ten_minutes = timedelta(minutes=10)

          # We don't do this on behalf of users

          koji_session = get_session(conf, login=False)

          log.info("Querying tasks for statuses:")
@@ -119,15 +120,17 @@ 

              if not component_build.task_id:

                  continue

  

-             # Don't check tasks for components which have been reused,

-             # they may have BUILDING state temporarily before we tag them

-             # to new module tag. Checking them would be waste of resources.

+             # For components which have been reused, wait 10 minutes before checking.

+             # They may be in BUILDING state temporarily before we tag them

+             # to new module tag. Checking them at that point would be waste of resources.

              if component_build.reused_component_id:

-                 log.debug(

-                     'Skipping check for task "%s", the component has been reused ("%s").',

-                     component_build.task_id, component_build.reused_component_id

-                 )

-                 continue

+                 now = datetime.utcnow()

+                 if (now - component_build.module_build.time_modified) < ten_minutes:

+                     log.debug(

+                         'Skipping check for task "%s", the component has been reused ("%s").',

+                         component_build.task_id, component_build.reused_component_id

+                     )

+                     continue

  

              task_id = component_build.task_id

  
@@ -165,6 +168,7 @@ 

                      build_name=component_build.package,

                      build_release=build_release,

                      build_version=build_version,

+                     module_build_id=component_build.module_build.id,

                  )

  

      elif conf.system == "mock":

This doesn't exactly fix #1621, but it does work around the most common expression of it that we are currently seeing.

Build a1494e6 FAILED!
Rebase or make new commits to rebuild.

Commit 31412a4 fixes this pull-request

Pull-Request has been merged by mikem

2 years ago
Metadata