Merge lp:~marcustomlinson/unity-scopes-api/oa-test-fix into lp:unity-scopes-api/devel

Proposed by Marcus Tomlinson on 2016-08-02
Status: Merged
Approved by: Michi Henning on 2016-08-02
Approved revision: 686
Merged at revision: 686
Proposed branch: lp:~marcustomlinson/unity-scopes-api/oa-test-fix
Merge into: lp:unity-scopes-api/devel
Prerequisite: lp:~michihenning/unity-scopes-api/fix-crossbuild
Diff against target: 36 lines (+13/-1)
1 file modified
src/scopes/internal/OnlineAccountClientImpl.cpp (+13/-1)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-api/oa-test-fix
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Approve on 2016-09-07
Michi Henning (community) 2016-08-02 Approve on 2016-08-02
Review via email: mp+301777@code.launchpad.net

Commit message

Don't deadlock waiting for a login session in OnlineAccountClient

To post a comment you must log in.
686. By Marcus Tomlinson on 2016-08-02

Merge fix-crossbuild

unity-api-1-bot (unity-api-1-bot) wrote :

FAILED: Continuous integration, rev:685
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/36/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/267/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/273
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/207
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/207
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/207
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/136/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/136/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/136/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/136/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/136/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/136/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/136/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/136/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/136/console

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/36/rebuild

review: Needs Fixing (continuous-integration)
unity-api-1-bot (unity-api-1-bot) wrote :

FAILED: Continuous integration, rev:686
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/37/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/269/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/275
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=vivid+overlay/209
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=xenial+overlay/209
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-1-sourcepkg/release=yakkety/209
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/138/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/138/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/138/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/138/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/138/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/138/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/138/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/138/console
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/138/console

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/37/rebuild

review: Needs Fixing (continuous-integration)
Michi Henning (michihenning) wrote :

Thanks for tracking this down!

review: Approve
unity-api-1-bot (unity-api-1-bot) wrote :

FAILED: Continuous integration, rev:686
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/43/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/575/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/581
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/407
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/407/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/407
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/407/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/407/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/407
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/407/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/407
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/407/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/407/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/407
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/407/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/407
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/407/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/407/console

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/43/rebuild

review: Needs Fixing (continuous-integration)
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:686
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/44/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/576
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/582
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/408/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/408
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/408/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scopes-api-ci/44/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 'src/scopes/internal/OnlineAccountClientImpl.cpp'
2--- src/scopes/internal/OnlineAccountClientImpl.cpp 2016-03-16 12:08:16 +0000
3+++ src/scopes/internal/OnlineAccountClientImpl.cpp 2016-08-02 13:28:57 +0000
4@@ -545,12 +545,15 @@
5 // (ensures that accounts_ is up to date)
6 std::shared_ptr<GMainLoop> event_loop;
7 event_loop.reset(g_main_loop_new(main_loop_context_.get(), true), g_main_loop_unref);
8- while(info->session)
9+
10+ int ms_elapsed = 0;
11+ while (info->session && ms_elapsed < 5000)
12 {
13 // We need to wait inside an event loop to allow for the main application loop to
14 // process its pending events
15 std::shared_ptr<GSource> source;
16 source.reset(g_timeout_source_new(10), g_source_unref);
17+ ms_elapsed += 10;
18 g_source_set_callback(source.get(), wake_up_event_loop_cb, event_loop.get(), NULL);
19 g_source_attach(source.get(), main_loop_context_.get());
20
21@@ -560,6 +563,15 @@
22 lock.lock();
23 info_lock.lock();
24 }
25+
26+ // If the login session is still not responding, we cancel it
27+ if (info->session)
28+ {
29+ std::cerr << "OnlineAccountClientImpl::flush_pending_session(): login for account: "
30+ << info->account_id << " is not responding. Canceling session." << std::endl;
31+ signon_auth_session_cancel(info->session.get());
32+ info->session = nullptr;
33+ }
34 }
35
36 void OnlineAccountClientImpl::main_loop_state_notify(bool is_running)

Subscribers

People subscribed via source and target branches

to all changes: