sync-images action output shows completed when gsss process is already running

Bug #1940965 reported by jarred wilson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Glance-Simplestreams-Sync Charm
Fix Committed
Medium
Yamen Hatahet

Bug Description

When running the sync-images action, the action will not be performed if an instance of gsss is already running. The issue is that the action will show to be completed and not give any useful output communicating that gsss did not actually run the sync-image action.

def main():
    log.info("glance-simplestreams-sync started.")

    lockfile = open(SYNC_RUNNING_FLAG_FILE_NAME, 'w')

    try:
        fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
    except IOError:
        log.info("{} is locked, exiting".format(SYNC_RUNNING_FLAG_FILE_NAME))
        sys.exit(0) <--- EXITS HERE

unit-glance-simplestreams-sync-0:
  UnitId: glance-simplestreams-sync/0
  id: "87"
  results: {}
  status: completed
  timing:
    completed: 2021-08-24 13:37:03 +0000 UTC
    enqueued: 2021-08-24 13:37:02 +0000 UTC
    started: 2021-08-24 13:37:02 +0000 UTC

A more verbose output would be helpful to let you know that it aborted.

Changed in charm-glance-simplestreams-sync:
status: New → Triaged
importance: Undecided → Medium
tags: added: good-first-bug
Changed in charm-glance-simplestreams-sync:
assignee: nobody → Muhammad Ahmad (ahmadfsbd)
Changed in charm-glance-simplestreams-sync:
assignee: Muhammad Ahmad (ahmadfsbd) → nobody
Yamen Hatahet (yhatahet)
Changed in charm-glance-simplestreams-sync:
assignee: nobody → Yamen Hatahet (yhatahet)
Changed in charm-glance-simplestreams-sync:
status: Triaged → In Progress
Revision history for this message
Yamen Hatahet (yhatahet) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-glance-simplestreams-sync (master)

Reviewed: https://review.opendev.org/c/openstack/charm-glance-simplestreams-sync/+/874196
Committed: https://opendev.org/openstack/charm-glance-simplestreams-sync/commit/6d8489d8cc50685b420f5a027f78528a85e8b0d2
Submitter: "Zuul (22348)"
Branch: master

commit 6d8489d8cc50685b420f5a027f78528a85e8b0d2
Author: Liam Young <email address hidden>
Date: Mon Jan 16 16:04:50 2023 +0000

    Failed action due to locked file made more verbose

    Fixes issue where a failed action due to a locked file returns an exit
    status of 0 and shows a status of "complete". The failed action now
    returns exit status 2, and the message is more verbose. Added actions
    file to handle all actions with symbolic links to said file.

    Closes-Bug: #1940965
    Change-Id: Ie950efee8d1052d33274b0fe07ff81f343e9f3e6

Changed in charm-glance-simplestreams-sync:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.