Merge lp:~mterry/ubuntu-system-settings/careful-sockets into lp:ubuntu-system-settings

Proposed by Michael Terry
Status: Merged
Approved by: Ken VanDine
Approved revision: 904
Merged at revision: 904
Proposed branch: lp:~mterry/ubuntu-system-settings/careful-sockets
Merge into: lp:ubuntu-system-settings
Diff against target: 12 lines (+1/-3)
1 file modified
wizard/ubuntu-system-settings-wizard.conf (+1/-3)
To merge this branch: bzr merge lp:~mterry/ubuntu-system-settings/careful-sockets
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ken VanDine Approve
Michał Sawicz (community) Approve
Review via email: mp+230690@code.launchpad.net

Commit message

Avoid a race condition when cleaning up the wizard's Mir socket. This way we won't delete unity8's Mir socket out from under it.

Description of the change

Avoid a race condition when cleaning up the wizard's Mir socket. This way we won't delete unity8's Mir socket out from under it.

The problem is that the cleanup job stops the wizard, which lets unity8 continue starting (the wizard interrupts unity8 starting). The post-stop job for the wizard looked like:

    if ! [ -e "$HOME/$RUN_FILE" ]; then
        rm -f "$MIR_SOCKET"
    fi

But unity8's job might actually re-define the global upstart value of $MIR_SOCKET by the time this code runs. In fact, $HOME/$RUN_FILE may or may not be created by the time this runs either. Bunch of races.

My solution is to just unconditionally delete the specific Mir socket that the wizard creates, rather than rely on $MIR_SOCKET.

I *think* this will fix bug 1355726. I'm fairly confident that it will fix the part I can reproduce. But I can't reproduce the unity8-greeter-doesn't-appear problem. We'll see. Maybe that's also a by-product of Mir being surprised by its sudden lack of socket.

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :

Makes sense.

review: Approve
Revision history for this message
Ken VanDine (ken-vandine) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:904
http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-ci/1227/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3490
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2747
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-amd64-ci/420
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/416
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-armhf-ci/416/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-system-settings-utopic-i386-ci/419
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3390
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4737
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4737/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11415
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2222
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3024
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3024/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-system-settings-ci/1227/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wizard/ubuntu-system-settings-wizard.conf'
2--- wizard/ubuntu-system-settings-wizard.conf 2014-08-06 19:18:13 +0000
3+++ wizard/ubuntu-system-settings-wizard.conf 2014-08-13 16:55:03 +0000
4@@ -45,7 +45,5 @@
5 end script
6
7 post-stop script
8- if ! [ -e "$HOME/$RUN_FILE" ]; then
9- rm -f "$MIR_SOCKET"
10- fi
11+ rm -f "$XDG_RUNTIME_DIR/wizard_socket"
12 end script

Subscribers

People subscribed via source and target branches