Mir

Merge lp:~alan-griffiths/mir/no-unbounded-multimaps into lp:mir

Proposed by Alan Griffiths on 2017-08-17
Status: Rejected
Rejected by: Alan Griffiths on 2017-08-18
Proposed branch: lp:~alan-griffiths/mir/no-unbounded-multimaps
Merge into: lp:mir
Diff against target: 26 lines (+2/-13)
1 file modified
src/server/frontend/session_mediator.cpp (+2/-13)
To merge this branch: bzr merge lp:~alan-griffiths/mir/no-unbounded-multimaps
Reviewer Review Type Date Requested Status
Chris Halse Rogers 2017-08-17 Disapprove on 2017-08-17
Mir CI Bot continuous-integration Approve on 2017-08-17
Review via email: mp+329192@code.launchpad.net

Commit message

mf::SessionMediator: Prevent stream_associated_buffers from growing without bound

Description of the change

Chris spotted this issue in: lp:~raof/mir/no-unbounded-multimaps/+merge/329174, but I think this is a better solution.

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4231
https://mir-jenkins.ubuntu.com/job/mir-ci/3559/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4877
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5092
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5081
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5081
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5081
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4914
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4914/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4914
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4914/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4914
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4914/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4914
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4914/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4914
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4914/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4914
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4914/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4914
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4914/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4914
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4914/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3559/rebuild

review: Approve (continuous-integration)
Chris Halse Rogers (raof) wrote :

This modifies the wrong codepath; this will dissociate *every* buffer associated with a stream the first time *any* buffer associated with a stream is released, and won't disassociate buffers from streams that get released.

review: Disapprove

Unmerged revisions

4231. By Alan Griffiths on 2017-08-17

mf::SessionMediator: Prevent stream_associated_buffers from growing without bound.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/frontend/session_mediator.cpp'
2--- src/server/frontend/session_mediator.cpp 2017-08-16 06:40:10 +0000
3+++ src/server/frontend/session_mediator.cpp 2017-08-17 09:58:07 +0000
4@@ -572,20 +572,9 @@
5
6 if (request->has_id())
7 {
8- auto const stream_id = mf::BufferStreamId{request->id().value()};
9-
10- auto const associated_range = stream_associated_buffers.equal_range(stream_id);
11- for (auto match = associated_range.first; match != associated_range.second;)
12- {
13- auto const current = match;
14- ++match;
15- if (std::find(to_release.begin(), to_release.end(), current->second) != to_release.end())
16- {
17-
18- stream_associated_buffers.erase(current);
19- }
20- }
21+ stream_associated_buffers.erase(mf::BufferStreamId{request->id().value()});
22 }
23+
24 for (auto const& buffer_id : to_release)
25 {
26 buffer_cache.erase(buffer_id);

Subscribers

People subscribed via source and target branches