Merge lp://staging/~marcustomlinson/unity-scope-click/lp-1591422 into lp://staging/unity-scope-click

Proposed by Marcus Tomlinson
Status: Merged
Approved by: dobey
Approved revision: 463
Merged at revision: 463
Proposed branch: lp://staging/~marcustomlinson/unity-scope-click/lp-1591422
Merge into: lp://staging/unity-scope-click
Diff against target: 56 lines (+20/-4)
2 files modified
libclickscope/click/preview.cpp (+10/-2)
libclickscope/click/ubuntuone_credentials.cpp (+10/-2)
To merge this branch: bzr merge lp://staging/~marcustomlinson/unity-scope-click/lp-1591422
Reviewer Review Type Date Requested Status
dobey (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+297269@code.staging.launchpad.net

Commit message

Ignore promise_already_satisfied exceptions thrown from getCredentials() signal handlers

To post a comment you must log in.
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Looking at:

    https://errors.ubuntu.com/problem/f271ff40a203e6d22ab0bf36beb8f6f6adddb90a,

we can see that the crash originates from:

    ubuntuone_credentials.cpp:63 -> "promise.set_value(token);"

Digging a little deeper into the future source, _M_set_result() seems to only throw std::future_error for the promise_already_satisfied condition. This unhandled exception is tearing down the scope.

We have 2 places in code where getCredentials() is called:
    click::CredentialsService::getToken()
    & InstalledPreview::get_consumer_key()

I suspect that during "QCoreApplication::processEvents();" in click::CredentialsService::getToken(), we may risk processing 2 getCredentials() calls in parallel, causing multiple callbacks into the signal handler.

This change adds a safety net which may or may not make the issue go away completely, but it certainly shouldn't make things any worse.

Revision history for this message
dobey (dobey) wrote :

The basics of this look sound, but would be nice if the statements were structured consistent with the rest of the code, like so:

try {
    promise.set_value();
} catch (const std::future_error&) {
    // Ignore promise_already_satisfied
}

review: Needs Fixing
463. By Marcus Tomlinson

Fixed formatting

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> The basics of this look sound, but would be nice if the statements were
> structured consistent with the rest of the code, like so:
>
> try {
> promise.set_value();
> } catch (const std::future_error&) {
> // Ignore promise_already_satisfied
> }

Sure, done.

Revision history for this message
dobey (dobey) :
review: Approve

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