Mir

Merge lp://qastaging/~andreas-pokorny/mir/fake-event-hub-to-fake-input-server-configuration into lp://qastaging/mir

Proposed by Andreas Pokorny
Status: Work in progress
Proposed branch: lp://qastaging/~andreas-pokorny/mir/fake-event-hub-to-fake-input-server-configuration
Merge into: lp://qastaging/mir
Prerequisite: lp://qastaging/~andreas-pokorny/mir/stub-legacy-input-dispatchable
Diff against target: 677 lines (+161/-117)
10 files modified
benchmarks/frame-uniformity/touch_producing_server.cpp (+12/-10)
benchmarks/frame-uniformity/touch_producing_server.h (+5/-2)
src/server/input/default_input_manager.cpp (+35/-23)
src/server/input/default_input_manager.h (+5/-2)
tests/acceptance-tests/throwback/test_client_cursor_api.cpp (+15/-15)
tests/include/mir_test_framework/fake_input_server_configuration.h (+12/-22)
tests/integration-tests/input/test_cursor_listener.cpp (+2/-3)
tests/integration-tests/test_server_shutdown.cpp (+59/-12)
tests/mir_test_framework/CMakeLists.txt (+1/-1)
tests/mir_test_framework/fake_input_server_configuration.cpp (+15/-27)
To merge this branch: bzr merge lp://qastaging/~andreas-pokorny/mir/fake-event-hub-to-fake-input-server-configuration
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Needs Fixing
Robert Carr (community) Approve
Kevin DuBois (community) Needs Fixing
Review via email: mp+258845@code.qastaging.launchpad.net

Commit message

Switch all tests to FakeInputServerConfiguration, and ensure that DefaultInputManagers dispatchables are unlinked from the MutliplexingDispatchable in all shutdown paths.

Description of the change

Change FakeEventHubServerConfiguration into FakeInputServerConfiguration - a server configuration that ensures that an input platform is loaded that can be used with fake input devices.

There were a few copies of FakeEventHubServerConfigration in the code, those were changed to. Hence the shutdown case: exception during user input processing was converted to. That required a cleanup of the DefaultInputManager 'stop' paths.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2369. By Andreas Pokorny

merge clang fix

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
2370. By Andreas Pokorny

include not needed

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

183+ for (auto const platform : platforms)
const&?

123+ if (!state.compare_exchange_strong(expected, State::running))
Close to my EOD (and my brain's somewhat cooked), but the existing code doesn't look threadsafe, and this could still have an interleaving of stop() and start(). I'd guess the start and stop need to be exclusive (maybe a 'start', 'stop' and 'transitioning' state could work). If its also not threadsafe now, could we leave it as is?

review: Needs Fixing
2371. By Andreas Pokorny

merge prereq

2372. By Andreas Pokorny

merge prereq

2373. By Andreas Pokorny

fixing missing ref

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

> 123+ if (!state.compare_exchange_strong(expected, State::running))
> Close to my EOD (and my brain's somewhat cooked), but the existing code
> doesn't look threadsafe, and this could still have an interleaving of stop()
> and start(). I'd guess the start and stop need to be exclusive (maybe a
> 'start', 'stop' and 'transitioning' state could work). If its also not
> threadsafe now, could we leave it as is?

Yes it is not safe against interleaving start/stop calls. This change only helps against parallel stop calls.. Looking at the code again, it also lacks exception safety. I think I should bring it on par with the start/stop behavior of MultithreadedCompositor

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Carr (robertcarr) wrote :

LGTM Besides the mentioned exception safety in start/stop.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

The only blocking issue I see is the exception safety.

~~~~

One nit:

89 + std::unique_ptr<mir_test_framework::FakeInputDevice> touch_screen;

const?

~~~~

One (pre-existing) wish:

359 std::shared_ptr<mir::input::InputManager> the_input_manager() override;
360 std::shared_ptr<mir::input::InputDispatcher> the_input_dispatcher() override;
...
362 std::shared_ptr<mir::input::InputSender> the_input_sender() override;

A shame these are needed but are not customization points in mir::Server (as that would go a long way to getting rid of these "throwback" tests).

review: Needs Fixing
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Uh, I nearly forgot about that branch.

> One (pre-existing) wish:
>
> 359 std::shared_ptr<mir::input::InputManager> the_input_manager()
> override;
> 360 std::shared_ptr<mir::input::InputDispatcher>
> the_input_dispatcher() override;
> ...
> 362 std::shared_ptr<mir::input::InputSender> the_input_sender()
> override;
>
> A shame these are needed but are not customization points in mir::Server (as
> that would go a long way to getting rid of these "throwback" tests).

I believe none of those three are touched in throwback. I think throwback could be cleaned if we add a customization point to track the scene contents (cursor + touch vizsualiation) and the used cursor buffers. Hmm the other remaining would be focus tracking.. We might get away by testing for focus events on the client?

2374. By Andreas Pokorny

merge lp:mir

2375. By Andreas Pokorny

merge lp:mir

2376. By Andreas Pokorny

nits fixed additional tear down on stop

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

hm maybe my last change was unnecessary as unique_ptr should cover that case nicely..

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2377. By Andreas Pokorny

revert additional stack unwinding code

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> > One (pre-existing) wish:
> >
> > 359 std::shared_ptr<mir::input::InputManager> the_input_manager()
> > override;
> > 360 std::shared_ptr<mir::input::InputDispatcher>
> > the_input_dispatcher() override;
> > ...
> > 362 std::shared_ptr<mir::input::InputSender> the_input_sender()
> > override;
>
> I believe none of those three are touched in throwback. I think throwback
> could be cleaned if we add a customization point to track the scene contents
> (cursor + touch vizsualiation) and the used cursor buffers. Hmm the other
> remaining would be focus tracking.. We might get away by testing for focus
> events on the client?

You say they are "not touched" but the tests use this configuration and this configuration implements these overrides. So touched or not they are used.

Revision history for this message
Kevin DuBois (kdub) wrote :

Especially given that start/stop isn't on a critical path, guarding against interleaving start/stop calls seems like something thats easy to do with a mutex... but if that's not the goal, it seems okay to guard against many stop() or start() calls this way. So I guess still needs fixing on the exception safety.

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

So..is this work in progress? Or still needs review?

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> So..is this work in progress? Or still needs review?

"Needs fixing" on the exception safety.

2378. By Andreas Pokorny

merged lp:mir

2379. By Andreas Pokorny

Mutually exclude multiple start and stop executions

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Am I missing something?

AFAICS this has been blocked for four weeks over on the same issue (exception safety) and the latest revision does not address this.

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

> Am I missing something?
>
> AFAICS this has been blocked for four weeks over on the same issue (exception
> safety) and the latest revision does not address this.

No you are not. I returned to the branch today.. and I am still on it.

Unmerged revisions

2379. By Andreas Pokorny

Mutually exclude multiple start and stop executions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches