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
=== modified file 'src/scopes/internal/OnlineAccountClientImpl.cpp'
--- src/scopes/internal/OnlineAccountClientImpl.cpp 2016-03-16 12:08:16 +0000
+++ src/scopes/internal/OnlineAccountClientImpl.cpp 2016-08-02 13:28:57 +0000
@@ -545,12 +545,15 @@
545 // (ensures that accounts_ is up to date)545 // (ensures that accounts_ is up to date)
546 std::shared_ptr<GMainLoop> event_loop;546 std::shared_ptr<GMainLoop> event_loop;
547 event_loop.reset(g_main_loop_new(main_loop_context_.get(), true), g_main_loop_unref);547 event_loop.reset(g_main_loop_new(main_loop_context_.get(), true), g_main_loop_unref);
548 while(info->session)548
549 int ms_elapsed = 0;
550 while (info->session && ms_elapsed < 5000)
549 {551 {
550 // We need to wait inside an event loop to allow for the main application loop to552 // We need to wait inside an event loop to allow for the main application loop to
551 // process its pending events553 // process its pending events
552 std::shared_ptr<GSource> source;554 std::shared_ptr<GSource> source;
553 source.reset(g_timeout_source_new(10), g_source_unref);555 source.reset(g_timeout_source_new(10), g_source_unref);
556 ms_elapsed += 10;
554 g_source_set_callback(source.get(), wake_up_event_loop_cb, event_loop.get(), NULL);557 g_source_set_callback(source.get(), wake_up_event_loop_cb, event_loop.get(), NULL);
555 g_source_attach(source.get(), main_loop_context_.get());558 g_source_attach(source.get(), main_loop_context_.get());
556559
@@ -560,6 +563,15 @@
560 lock.lock();563 lock.lock();
561 info_lock.lock();564 info_lock.lock();
562 }565 }
566
567 // If the login session is still not responding, we cancel it
568 if (info->session)
569 {
570 std::cerr << "OnlineAccountClientImpl::flush_pending_session(): login for account: "
571 << info->account_id << " is not responding. Canceling session." << std::endl;
572 signon_auth_session_cancel(info->session.get());
573 info->session = nullptr;
574 }
563}575}
564576
565void OnlineAccountClientImpl::main_loop_state_notify(bool is_running)577void OnlineAccountClientImpl::main_loop_state_notify(bool is_running)

Subscribers

People subscribed via source and target branches

to all changes: