swift-recon-cron lock dir not removed on failure

Bug #1251713 reported by Christopher H. Laco
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
In Progress
Undecided
Christopher H. Laco

Bug Description

Under certain circumstances, if get_async_count or dump_cron_cache calls fail, the lock_dir is not cleaned up.

You can simulate this by running this cron on a machine without /srv/node, which will yield the following exception:

Traceback (most recent call last):
  File "/usr/bin/swift-recon-cron", line 78, in <module>
    main()
  File "/usr/bin/swift-recon-cron", line 70, in main
    dump_recon_cache({'async_pending': asyncs}, cache_file, logger)
UnboundLocalError: local variable 'asyncs' referenced before assignment

All subsequent executions of swift-recon-cron will fail with the following error until the lock_dir is removed:

[Errno 17] File exists: '/var/lock/swift/swift-recon-object-cron'
2013 Nov 15 16:44:02 storage-server-1 [Errno 17] File exists: '/var/lock/swift/swift-recon-object-cron'

Error handling should probably be a bit more robust to ensure the lock_dir always gets removed. Patch forthcoming.

Changed in swift:
assignee: nobody → Christopher H. Laco (claco)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/56670

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.