lp://qastaging/~zyga/checkbox/fix-1318504

Created by Zygmunt Krynicki and last modified
Get this branch:
bzr branch lp://qastaging/~zyga/checkbox/fix-1318504
Only Zygmunt Krynicki can upload to this branch. If you are Zygmunt Krynicki please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Zygmunt Krynicki
Project:
Checkbox
Status:
Merged

Recent revisions

3031. By Zygmunt Krynicki

checkbox-ng:service: remove useless locking

This patch removes all locks used by checkbox-ng's service code.

First some background about concurrent.futures._base.Future's
add_done_callback() method:

 | add_done_callback(self, fn)
 | Attaches a callable that will be called when the future finishes.
 |
 | Args:
 | fn: A callable that will be called with this future as its only
 | argument when the future completes or is cancelled. The callable
 | will always be called by a thread in the same process in which
 | it was added. If the future has already completed or been
 | cancelled then the callable will be called immediately. These
 | callables are called in the order that they were added.

The *essential* fact is that the thread eventually calls the callback is
always the same thread that was used to register the method.

Since we have two threads here (basically, there are more but here only
two will interact):

1) The thread running almost all the python code in service.py
   and elsewhere. This is where we handle requests sent via DBus
2) The thread that just blocks on the job runner to finish.
   This thread is created indirectly with multiprocessing used by
   the highlevel module.

The original intent of _result_lock was, to quote:

    # A lock that protects access to :ivar:`_result` and
    # :ivar:`_result_future` from concurrent access from the thread that is
    # executing Future callback which we register, the
    # :meth:`_result_ready()`

Which is entirely bogus as there are no threads like that. Had I known
there was the callback guarantee I would never had added that lock in
the first place.

Fixes: https://bugs.launchpad.net/plainbox/+bug/1318504

Signed-off-by: Zygmunt Krynicki <email address hidden>

3030. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

3029. By Sylvain Pineau

"automatic merge by tarmac [r=zkrynicki][bug=1315337][author=sylvain-pineau]"

3028. By Daniel Manrique

"tarmac-verify: fix setting of KEEP_DATA environment variable.

Without this fix, we use --keep-data all the time, making lxc much slower as it uses actual disk storage instead of blazing-fast tmpfs on ram. [r=roadmr][bug=][author=roadmr]"

3027. By Zygmunt Krynicki

"automatic merge by tarmac [r=roadmr][bug=][author=zkrynicki]"

3026. By Zygmunt Krynicki

"automatic merge by tarmac [r=roadmr][bug=1302388][author=zkrynicki]"

3025. By Zygmunt Krynicki

"automatic merge by tarmac [r=roadmr][bug=][author=zkrynicki]"

3024. By Po-Hsu Lin

"automatic merge by tarmac [r=roadmr][bug=1321356][author=cypressyew]"

3023. By Zygmunt Krynicki

"automatic merge by tarmac [r=roadmr][bug=][author=zkrynicki]"

3022. By Po-Hsu Lin

"automatic merge by tarmac [r=roadmr][bug=1321995][author=cypressyew]"

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp://qastaging/checkbox
This branch contains Public information 
Everyone can see this information.

Subscribers