update-committed-patches should only allow one instance

Bug #1203980 reported by Philip Colmer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro patch metrics
Invalid
Undecided
Unassigned

Bug Description

There is currently a problem, reported by Ben, where update-committed-patches is locking up. Unfortunately, along comes a second instance and that starts chewing up CPU as well as the first one.

The script needs to ensure that only one instance of the script is running at a time in order to ensure that a long-running instance doesn't get trampled on by another newer instance.

Revision history for this message
Milo Casagrande (milo) wrote : Re: [Bug 1203980] [NEW] update-committed-patches should only allow one instance

On Tue, Jul 23, 2013 at 8:54 AM, Philip Colmer <email address hidden> wrote:
>
> There is currently a problem, reported by Ben, where update-committed-
> patches is locking up. Unfortunately, along comes a second instance and
> that starts chewing up CPU as well as the first one.
>
> The script needs to ensure that only one instance of the script is
> running at a time in order to ensure that a long-running instance
> doesn't get trampled on by another newer instance.

The script (update-committed-patches) is doing, or at least should be
doing, that already.
This is the code snippet taken from the script:

lock = FileLock('/var/lock/update-committed-patches')
try:
    lock.acquire(timeout=10)
except LockFailed, e:
    sys.stderr.write("Failed to acquire lock: %s\n" % e)
except LockTimeout, e:
    sys.stderr.write(
        "Another process seems to be running; can't acquire lock")
else:
    try:
        main()
    finally:
        lock.release()

It is probably worth investigating what is happening there.

--
Milo Casagrande | Automation Engineer
Linaro.org <www.linaro.org> │ Open source software for ARM SoCs

Revision history for this message
Milo Casagrande (milo) wrote :

I just tested on the staging instance, and the locking mechanism is working correctly (as long as the python-lockfile package is installed).

We might need more info on the exact behavior experienced in order to make sure the script is working correctly.
Not sure if that was the case of multiple scripts (not the same one) running and requiring git operations. At least two patches script perform git operations that can be resource demanding.

Closing this for now, if it happens again please reopen it with as much info as possible (processes running, process names...).

Changed in linaro-patchmetrics:
status: New → Invalid
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.