cronjobs erroneously report removed lock files

Bug #904033 reported by Hartmut Holzgraefe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Eventum
Fix Released
Low
Elan Ruusamäe

Bug Description

When starting the mail queue and download cronjobs with --fix-locks they will always print that they removed lock files even when no lock file existed at all.

When running this within a cron job an email report will always be triggered, i'd rather like to have a report sent to me only if there really was a stale lock file that needed to be removed.

Related branches

Revision history for this message
Hartmut Holzgraefe (hartmut-php) wrote :

Branch fixes this by making Lock::release() return true if it actually removed a lock file, false otherwise and only printing "removed lock file" messages in the cron job scripts if true is returend from Lock::release()

Revision history for this message
Harri Porten (porten-deactivatedaccount) wrote :

The nasty part about the code (not necessarily the patch itself) is that 'false' will be returned from release() in cases of both file missing *and* the release failing.

Maybe it would be easiest to reverse the logic? "Failed to remove lock file" is printed out if the operation fails but *no* output is printed in the two other cases.

Revision history for this message
Elan Ruusamäe (glen666) wrote :

Committed revision 4453.

Changed in eventum:
assignee: nobody → Elan Ruusamäe (glen666)
importance: Undecided → Low
status: New → Fix Committed
Elan Ruusamäe (glen666)
Changed in eventum:
milestone: none → 2.3.3
status: Fix Committed → Fix Released
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.