Merge lp:~nick-dedekind/qtmir/polite-close into lp:qtmir
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Daniel d'Andrada on 2015-09-29 | ||||
| Approved revision: | 359 | ||||
| Merged at revision: | 424 | ||||
| Proposed branch: | lp:~nick-dedekind/qtmir/polite-close | ||||
| Merge into: | lp:qtmir | ||||
| Prerequisite: | lp:~dandrader/qtmir/detach-state-from-focus | ||||
| Diff against target: |
726 lines (+343/-24) 17 files modified
debian/changelog (+7/-0) src/modules/Unity/Application/application.cpp (+42/-9) src/modules/Unity/Application/application.h (+7/-0) src/modules/Unity/Application/application_manager.cpp (+52/-12) src/modules/Unity/Application/application_manager.h (+3/-0) src/modules/Unity/Application/mirsurface.cpp (+7/-0) src/modules/Unity/Application/mirsurface.h (+2/-0) src/modules/Unity/Application/mirsurfaceinterface.h (+2/-0) src/modules/Unity/Application/session.cpp (+40/-2) src/modules/Unity/Application/session.h (+1/-0) src/modules/Unity/Application/session_interface.h (+1/-0) tests/modules/Application/CMakeLists.txt (+5/-0) tests/modules/ApplicationManager/application_manager_test.cpp (+155/-0) tests/modules/common/fake_mirsurface.h (+7/-0) tests/modules/common/fake_session.h (+4/-0) tests/modules/common/mock_session.h (+1/-0) tests/modules/common/qtmir_test.h (+7/-1) |
||||
| To merge this branch: | bzr merge lp:~nick-dedekind/qtmir/polite-close | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| PS Jenkins bot | continuous-integration | 2015-06-17 | Needs Fixing on 2015-12-04 |
| Daniel d'Andrada (community) | Approve on 2015-09-29 | ||
| Gerry Boland | 2015-06-17 | Pending | |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2015-06-09.
Commit Message
Politely asks processes to close before resorting to killing
Description of the Change
Politely close applications.
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:341
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Gerry Boland (gerboland) wrote : | # |
Can I get you to rebase this on top of
https:/
as I expect collisions. Daniel re-worked the Application class to more clearly manage process state, which this branch would benefit from.
Something to keep in mind is we may be treating applications which don't close when we ask them differently on desktop & mobile platforms. It's not uncommon for desktop apps to pop up a "Save" dialog to prevent user loosing their work. For mobile, we may have this issue too, though I've no idea how we'll present it to the user.
As a result I think the "kill after 3 seconds" logic should belong to unity8.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:348
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:348
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Nick Dedekind (nick-dedekind) wrote : | # |
Logic for how a close request reacts (popup for confirm/error notification for hard exit/etc) will be dealt with by subsequent sprint cards. This is just a only a first pass.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:353
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:354
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:354
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 346. By Daniel d'Andrada <dandrader@panzer> on 2015-06-30
-
merge detach-
state-from- focus - 347. By Daniel d'Andrada <dandrader@panzer> on 2015-06-30
- 348. By Daniel d'Andrada <dandrader@panzer> on 2015-07-01
-
Modifications from review
- 349. By Daniel d'Andrada <dandrader@panzer> on 2015-07-01
-
Format is EXPECT_EQ(expected, actual)
- 350. By Daniel d'Andrada <dandrader@panzer> on 2015-07-01
-
Test change that makes it hang
| Daniel d'Andrada (dandrader) wrote : | # |
I think you're missing a clear definition of the Closing state and of the transitions from and to it. In the code I see it can be in the Closing state even if the process is suspended. If so, you resume it. This leads to uncertainty in the code as it can be in Closing but you don't know if it's suspended or running. This compromises the idea of tracking the internal state through this variable as it no longer clearly reflects what's going on.
In my opinion, an app is in Closing state *only* when:
- Its process is Running (or Unknown, which amounts to the same)
- The closing timer is ticking
So if someone calls Application:
The related code changes for this and some other small issues are here:
http://
| Daniel d'Andrada (dandrader) wrote : | # |
Format is EXPECT_EQ(expected, actual), not the other way around (yeah, it's the opposite of most other test APIs).
http://
| Daniel d'Andrada (dandrader) wrote : | # |
ApplicationMana
http://
It needs more work though, as you will have to mock/fake more stuff to make this code path function properly, like adding some fake implementation to the TaskController. so that AppMan calling TaskController-
| Daniel d'Andrada (dandrader) wrote : | # |
1 - Launch some app (e.g. filemanager)
2 - $ sudo gdb -p $(pidof filemanager)
3 - (gdb) cont
4 - do right-edge drag to show the spread and swipe up filemanager to close it.
expected outcome:
You see in gdb that app exits nicely
Actual outcome:
You get: "Program received signal SIGSEGV, Segmentation fault."
Comments:
Without this branch I get "Program received signal SIGTERM, Terminated." instead.
It might not be our fault be we should at least know why it's crashing.
- 351. By Nick Dedekind on 2015-09-07
-
merged with trunk
- 352. By Nick Dedekind on 2015-09-07
-
fixed up a few resume on closing things
- 353. By Nick Dedekind on 2015-09-07
-
fixed up some logs
| Nick Dedekind (nick-dedekind) wrote : | # |
> 1 - Launch some app (e.g. filemanager)
> 2 - $ sudo gdb -p $(pidof filemanager)
> 3 - (gdb) cont
> 4 - do right-edge drag to show the spread and swipe up filemanager to close
> it.
>
> expected outcome:
> You see in gdb that app exits nicely
>
> Actual outcome:
> You get: "Program received signal SIGSEGV, Segmentation fault."
>
> Comments:
> Without this branch I get "Program received signal SIGTERM, Terminated."
> instead.
>
> It might not be our fault be we should at least know why it's crashing.
This can be dealt with by another branch. the problem occurs in trunk as well.
tested with messaging-app (crash), dialer-app (crash), camera-app (no crash)
- 354. By Nick Dedekind on 2015-09-07
-
fixed close for sync
- 355. By Nick Dedekind on 2015-09-07
-
updated tests
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:355
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| Nick Dedekind (nick-dedekind) wrote : | # |
> ApplicationMana
> app while is still in Starting state. The more common case, which is what we
> should be testing, is closing an app in Running state. I changed the test
> accordingly:
>
> http://
>
> It needs more work though, as you will have to mock/fake more stuff to make
> this code path function properly, like adding some fake implementation to the
> TaskController. so that AppMan calling TaskController-
> the app session to end and then TaskController:
Thanks for the updates. I've merged in your work.
I've just called the appManager-
I've got another branch in the works for mocking the task controller. Can be merged separately.
| Nick Dedekind (nick-dedekind) wrote : | # |
> 1 - Launch some app (e.g. filemanager)
> 2 - $ sudo gdb -p $(pidof filemanager)
> 3 - (gdb) cont
> 4 - do right-edge drag to show the spread and swipe up filemanager to close
> it.
>
> expected outcome:
> You see in gdb that app exits nicely
>
> Actual outcome:
> You get: "Program received signal SIGSEGV, Segmentation fault."
>
> Comments:
> Without this branch I get "Program received signal SIGTERM, Terminated."
> instead.
>
> It might not be our fault be we should at least know why it's crashing.
I'll look into it when I get a minute. Seems to be crashing in libdbus-cpp.
| Daniel d'Andrada (dandrader) wrote : | # |
Code looks good. Didn't try it out on a device yet.
Two problems in the tests though:
1 - ApplicationMana
http://
2 - ApplicationMana
| Daniel d'Andrada (dandrader) wrote : | # |
> > 1 - Launch some app (e.g. filemanager)
> > 2 - $ sudo gdb -p $(pidof filemanager)
> > 3 - (gdb) cont
> > 4 - do right-edge drag to show the spread and swipe up filemanager to close
> > it.
> >
> > expected outcome:
> > You see in gdb that app exits nicely
> >
> > Actual outcome:
> > You get: "Program received signal SIGSEGV, Segmentation fault."
> >
> > Comments:
> > Without this branch I get "Program received signal SIGTERM, Terminated."
> > instead.
> >
> > It might not be our fault be we should at least know why it's crashing.
>
> This can be dealt with by another branch. the problem occurs in trunk as well.
> tested with messaging-app (crash), dialer-app (crash), camera-app (no crash)
Just tried three times with both messaging-app and dialer-app and didn't get any SIGSEGV with qtmir trunk.
| Gerry Boland (gerboland) wrote : | # |
> > 1 - Launch some app (e.g. filemanager)
> > 2 - $ sudo gdb -p $(pidof filemanager)
> > 3 - (gdb) cont
> > 4 - do right-edge drag to show the spread and swipe up filemanager to close
> > it.
> >
> > expected outcome:
> > You see in gdb that app exits nicely
> >
> > Actual outcome:
> > You get: "Program received signal SIGSEGV, Segmentation fault."
> >
> > Comments:
> > Without this branch I get "Program received signal SIGTERM, Terminated."
> > instead.
> >
> > It might not be our fault be we should at least know why it's crashing.
>
> This can be dealt with by another branch. the problem occurs in trunk as well.
> tested with messaging-app (crash), dialer-app (crash), camera-app (no crash)
Have you this branch prepared? We can't land this change if all apps will now crash on shutdown instead of being killed. It will cause apport to spin up for every app closed!
- 356. By Nick Dedekind on 2015-09-24
-
merged with trunk
- 357. By Nick Dedekind on 2015-09-25
-
version bump
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:357
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Gerry Boland (gerboland) wrote : | # |
Nick found that this bug is causing the crash in clients when trying to shut down cleanly:
https:/
| Nick Dedekind (nick-dedekind) wrote : | # |
- 358. By Nick Dedekind on 2015-09-29
-
updated comment
- 359. By Nick Dedekind on 2015-09-29
-
merged with trunk
| Daniel d'Andrada (dandrader) wrote : | # |
I confirm that those branches do fix the crash.
Now the only issue left is that mysterious test failure...
| Daniel d'Andrada (dandrader) wrote : | # |
Well, Saviq and CI have the test passing fine as well.
| Gerry Boland (gerboland) wrote : | # |
Please strip tags! It's a qtmir problem now to
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:359
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
| Gerry Boland (gerboland) wrote : | # |
Please merge qtmir trunk
- 360. By Nick Dedekind on 2015-11-02
-
merged with trunk
- 361. By Nick Dedekind on 2015-11-02
-
removed unnecessary cmake includes
- 362. By Nick Dedekind on 2015-11-09
-
merge with trunk
| Nick Dedekind (nick-dedekind) wrote : | # |
Fixe conflicts.
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:364
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
| PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:366
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 363. By Nick Dedekind on 2015-12-07
-
merged with trunk

PASSED: Continuous integration, rev:340 jenkins. qa.ubuntu. com/job/ qtmir-ci/ 282/ jenkins. qa.ubuntu. com/job/ qtmir-wily- amd64-ci/ 15 jenkins. qa.ubuntu. com/job/ qtmir-wily- armhf-ci/ 15 jenkins. qa.ubuntu. com/job/ qtmir-wily- armhf-ci/ 15/artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/qtmir- ci/282/ rebuild
http://