Merge lp://qastaging/~marcustomlinson/unity-scopes-api/strict_idle_timeout into lp://qastaging/unity-scopes-api/devel

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 691
Merged at revision: 690
Proposed branch: lp://qastaging/~marcustomlinson/unity-scopes-api/strict_idle_timeout
Merge into: lp://qastaging/unity-scopes-api/devel
Diff against target: 46 lines (+6/-6)
3 files modified
doc/tutorial.dox (+2/-1)
src/scopes/internal/ScopeConfig.cpp (+3/-4)
test/gtest/scopes/internal/ScopeConfig/ScopeConfig_test.cpp (+1/-1)
To merge this branch: bzr merge lp://qastaging/~marcustomlinson/unity-scopes-api/strict_idle_timeout
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Approve
Marcus Tomlinson (community) Approve
Michi Henning Pending
Review via email: mp+308346@code.qastaging.launchpad.net

This proposal supersedes a proposal from 2016-10-12.

Commit message

Be much stricter on idle timeout (1s to 5min)

Description of the change

Be much stricter on idle timeout (1s to 5min). Not only are scopes currently allowed to set very very large timeouts, we seem to allow disabling of the timeout entirely (a value of -1)

To post a comment you must log in.
Revision history for this message
Michi Henning (michihenning) wrote : Posted in a previous version of this proposal

Looks good to me. Did we have problems with a scopes setting unreasonable values?

Not sure where the -1 problem is. The previous code complained if the value was < 0, meaning that you can have a scope that times out immediately. (Not that useful, I admit.)

I can't recall why we allowed maxint :-(

review: Approve
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote : Posted in a previous version of this proposal

> Looks good to me. Did we have problems with a scopes setting unreasonable
> values?

I don't know of a particular case where a scope is doing this, but that's part of the concern I suppose. Feels like a bit of a security risk allowing scopes to essentially act like daemons this way.

>
> Not sure where the -1 problem is. The previous code complained if the value
> was < 0, meaning that you can have a scope that times out immediately. (Not
> that useful, I admit.)

If you look at the diff we allowed ((>=0 && <= max) || -1)

>
> I can't recall why we allowed maxint :-(

Me neither.

Revision history for this message
Michi Henning (michihenning) wrote : Posted in a previous version of this proposal

> I don't know of a particular case where a scope is doing this, but that's part
> of the concern I suppose. Feels like a bit of a security risk allowing scopes
> to essentially act like daemons this way.

Back then, we knew little about how scopes would be used and what they might be doing. I suspect that's why it ended up being so liberal.

> If you look at the diff we allowed ((>=0 && <= max) || -1)

Ah, yes. I didn't read it closely enough. Anyway, I think it's fine a limit it to five minutes. If that breaks some scope, we'll find out soon enough.

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

Targeted trunk by mistake. Re-approving for merge to devel

review: Approve
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :
review: Needs Fixing (continuous-integration)
691. By Marcus Tomlinson

Oops, fix ScopeConfig_test.cpp

Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

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

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

review: Approve (continuous-integration)

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

to all changes: