Merge lp:~raof/mir/observer-multiplexer into lp:mir
| Status: | Merged |
|---|---|
| Approved by: | Daniel van Vugt on 2016-10-31 |
| Approved revision: | 3771 |
| Merged at revision: | 3795 |
| Proposed branch: | lp:~raof/mir/observer-multiplexer |
| Merge into: | lp:mir |
| Prerequisite: | lp:~raof/mir/shared-mutex |
| Diff against target: |
1064 lines (+940/-2) 12 files modified
include/server/mir/executor.h (+57/-0) include/server/mir/main_loop.h (+6/-2) include/server/mir/observer_registrar.h (+92/-0) src/include/server/mir/glib_main_loop.h (+2/-0) src/include/server/mir/observer_multiplexer.h (+126/-0) src/server/CMakeLists.txt (+5/-0) src/server/glib_main_loop.cpp (+16/-0) tests/include/mir/test/doubles/mock_main_loop.h (+8/-0) tests/include/mir/test/doubles/triggered_main_loop.h (+4/-0) tests/mir_test_doubles/triggered_main_loop.cpp (+15/-0) tests/unit-tests/CMakeLists.txt (+1/-0) tests/unit-tests/test_observer_multiplexer.cpp (+608/-0) |
| To merge this branch: | bzr merge lp:~raof/mir/observer-multiplexer |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Mir CI Bot | continuous-integration | Approve on 2016-10-31 | |
| Andreas Pokorny (community) | Approve on 2016-10-26 | ||
| Alan Griffiths | Abstain on 2016-10-24 | ||
| Cemil Azizoglu (community) | Approve on 2016-10-13 | ||
| Chris Halse Rogers | Abstain on 2016-10-13 | ||
|
Review via email:
|
|||
Commit Message
Add ObserverRegistrar interface and an ObserverMultiplexer helper implementation.
An ObserverRegistrar manages registering and unregistering Observers of some Mir state.
The ObserverMultiplexer is an implementation of ObserverRegistrar which itself is an Observer, so can be handed out to internal Mir components as a singular Observer and to shells using Mir as an ObserverRegistrar.
At the moment ObserverMultiplexer requires code to implement Observer be provided manually. In The Glorious Future, C++ will provide compile-time reflection which will make it possible to automatically implement.
| Chris Halse Rogers (raof) wrote : | # |
I add a needs-information here for a design discussion:
I have been tempted to make the ObserverMultiplexer offload notification to the server event loop. This means we never have to care about the context in which the observer is called.
Observers loose the ability to deny an operation by throwing an exception, and get notified slightly later.
| Andreas Pokorny (andreas-pokorny) wrote : | # |
> I add a needs-information here for a design discussion:
>
> I have been tempted to make the ObserverMultiplexer offload notification to
> the server event loop. This means we never have to care about the context in
> which the observer is called.
If you could unify the scheduling part of MultiplexingDis
Have you considered letting the owner of the observer specify the thread(pool) of execution on registry?
> Observers loose the ability to deny an operation by throwing an exception, and
> get notified slightly later.
I believe the first sounds more like a policy interface. The delayed / asynchronous notification of observers is necessary for the use case of this utility. We cannot make a reasonable local decision that it is acceptable to synchronously execute unknown code added by 3rd parties. The case would be different for previously mentioned policy interfaces that help with a specific decision...
The problem of delayed execution and needing to know "are we done yet?" is something that we might have to address on a higher level?
| Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3768
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
| Chris Halse Rogers (raof) wrote : | # |
There you go, now with a C++17-ish Executor abstraction.
| Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3769
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
| Chris Halse Rogers (raof) wrote : | # |
07:32:29 [0;32m[ RUN ] [mAndroidInput
07:32:29 /build/
07:32:29 Expected: (duration) > (1ms), actual: 8-byte object <55-FC 0E-00 00-00 00-00> vs 8-byte object <01-00 00-00 00-00 00-00>
07:32:29 [0;31m[ FAILED ] [mAndroidInput
That's not related to this branch.
| Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3769
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
| Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3769
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
| Chris Halse Rogers (raof) wrote : | # |
05:00:09 [0;32m[ PASSED ] [m1543 tests.
05:00:09 [0;31m[ FAILED ] [m1 test, listed below:
05:00:09 [0;31m[ FAILED ] [mAndroidInput
AAAAand again.
| Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3769
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
| Cemil Azizoglu (cemil-azizoglu) wrote : | # |
Some plumbing for the dependent branch. Got it.
| Andreas Pokorny (andreas-pokorny) wrote : | # |
What happened to the mircommon symbols.map?
Otherwise lgtm
| Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3771
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
| Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3771
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
| Alan Griffiths (alan-griffiths) wrote : | # |
I'm not yet quite sure what problem this solves. (No followup branch demonstrating use?)
But, if the functionality is useful, then the code looks reasonable.
| Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
| Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
| Daniel van Vugt (vanvugt) wrote : | # |
^^^
CI failure is bug 1523621. Try again.

PASSED: Continuous integration, rev:3744 /mir-jenkins. ubuntu. com/job/ mir-ci/ 1876/ /mir-jenkins. ubuntu. com/job/ build-mir/ 2379 /mir-jenkins. ubuntu. com/job/ build-0- fetch/2442 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 2434 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 2434 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 2434 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 2408 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 2408/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2408 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2408/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 2408 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 2408/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 2408 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 2408/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 2408 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 2408/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2408 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2408/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 1876/rebuild
https:/