Lock file removed even if it fails to get a lock
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glance-simplestreams-sync (Juju Charms Collection) |
Fix Released
|
High
|
Данило Шеган |
Bug Description
We've noticed that the lockfile gets removed in cleanup() in scripts/
This manifests in multiple identical images being downloaded in the initial run when there is still a per-minute cronjob: eg. I've had anything from 3 xenial and 2 trusty images to 2 xenial and 1 trusty, depending on the network speed.
What happens is this:
1. A scripts kicks off, creates a lock file, and starts downloading images
2. If script from 1 still hasn't finished downloading, a run after one minute finds the lockfile, aborts and removes the lockfile
3. Two minutes in, if the script from 1 is still downloading, there is no more lockfile, so another run of the script will attempt to download the same images
...
The fix is simple, I'll be proposing a branch.
Related branches
- charmers: Pending requested
-
Diff: 16 lines (+1/-2)1 file modifiedscripts/glance-simplestreams-sync.py (+1/-2)
- charmers: Pending requested
-
Diff: 12 lines (+1/-0)1 file modifiedscripts/glance-simplestreams-sync.py (+1/-0)
Changed in glance-simplestreams-sync (Juju Charms Collection): | |
status: | New → In Progress |
assignee: | nobody → Данило Шеган (danilo) |
Changed in glance-simplestreams-sync-charm: | |
status: | In Progress → Invalid |
no longer affects: | glance-simplestreams-sync-charm |
Changed in glance-simplestreams-sync (Juju Charms Collection): | |
status: | In Progress → Fix Committed |
importance: | Undecided → High |
Changed in glance-simplestreams-sync (Juju Charms Collection): | |
status: | Fix Committed → Fix Released |
Note, this only applies to next, the trunk already has atexit handler moved past the exception handler, which works as well.