Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard the service protocol's global handlers list with a reader/writer lock #6888

Merged
merged 1 commit into from
Nov 17, 2018

Conversation

jason-simmons
Copy link
Member

The service protocol holds the lock while waiting for completion of service
RPC tasks. These tasks (specifically hot restart/RunInView) may need to
modify a handler's description data.

Task execution and ServiceProtocol::SetHandlerDescription will obtain a shared
lock to make this possible. AddHandler and RemoveHandler will obtain an
exclusive lock in order to guard against a handler being deleted while a
service task is running.

@@ -53,21 +53,21 @@ ServiceProtocol::~ServiceProtocol() {

void ServiceProtocol::AddHandler(Handler* handler,
Handler::Description description) {
std::lock_guard<std::mutex> lock(handlers_mutex_);
std::unique_lock<std::shared_timed_mutex> lock(handlers_mutex_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think shared_timed_mutex is C++14 only, can we use that here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works in the Clang builds. Does anyone know if shared_timed_mutex is available in the Windows toolchain?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this patch builds fine on windows too.

…r lock

The service protocol holds the lock while waiting for completion of service
RPC tasks.  These tasks (specifically hot restart/RunInView) may need to
modify a handler's description data.

Task execution and ServiceProtocol::SetHandlerDescription will obtain a shared
lock to make this possible.  AddHandler and RemoveHandler will obtain an
exclusive lock in order to guard against a handler being deleted while a
service task is running.
@jason-simmons jason-simmons merged commit 9352360 into flutter:master Nov 17, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 17, 2018
jason-simmons added a commit to jason-simmons/flutter_engine that referenced this pull request Nov 17, 2018
…er/writer lock (flutter#6888)"

This reverts commit 9352360.

(shared_timed_mutex is unavailable in the iOS build)
jason-simmons added a commit that referenced this pull request Nov 17, 2018
…er/writer lock (#6888)" (#6893)

This reverts commit 9352360.

(shared_timed_mutex is unavailable in the iOS build)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 17, 2018
jason-simmons added a commit to jason-simmons/flutter_engine that referenced this pull request Nov 17, 2018
…r lock (flutter#6888)

The service protocol holds the lock while waiting for completion of service
RPC tasks.  These tasks (specifically hot restart/RunInView) may need to
modify a handler's description data.

Task execution and ServiceProtocol::SetHandlerDescription will obtain a shared
lock to make this possible.  AddHandler and RemoveHandler will obtain an
exclusive lock in order to guard against a handler being deleted while a
service task is running.
jason-simmons added a commit to jason-simmons/flutter_engine that referenced this pull request Nov 17, 2018
…r lock (flutter#6888)

The service protocol holds the lock while waiting for completion of service
RPC tasks.  These tasks (specifically hot restart/RunInView) may need to
modify a handler's description data.

Task execution and ServiceProtocol::SetHandlerDescription will obtain a shared
lock to make this possible.  AddHandler and RemoveHandler will obtain an
exclusive lock in order to guard against a handler being deleted while a
service task is running.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 17, 2018
tvolkert pushed a commit that referenced this pull request Nov 18, 2018
…r lock (#6888) (#6895)

The service protocol holds the lock while waiting for completion of service
RPC tasks.  These tasks (specifically hot restart/RunInView) may need to
modify a handler's description data.

Task execution and ServiceProtocol::SetHandlerDescription will obtain a shared
lock to make this possible.  AddHandler and RemoveHandler will obtain an
exclusive lock in order to guard against a handler being deleted while a
service task is running.
tvolkert added a commit that referenced this pull request Nov 18, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 18, 2018
aam added a commit to aam/engine that referenced this pull request Nov 18, 2018
…h a reader/writer lock (flutter#6888) flutter#6895" (flutter#6899)"

This reverts commit b6e9375 and applies fix for tests on Windows.
aam added a commit that referenced this pull request Nov 18, 2018
…r lock. (#6900)

* Revert "Revert "Guard the service protocol's global handlers list with a reader/writer lock (#6888) #6895" (#6899)"

This reverts commit b6e9375 and applies fix for tests on Windows.

* Reland guard the service protocol's global handlers list with a reader/writer lock.

* Remove blank line
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 18, 2018
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Nov 19, 2018
flutter/engine@c02dd8f...cebde43

git log c02dd8f..cebde43 --no-merges --oneline
cebde43 Guard the service protocol&#39;s global handlers list with a reader/writer lock. (flutter/engine#6900)
b6e9375 Revert &#34;Guard the service protocol&#39;s global handlers list with a reader/writer lock (#6888) #6895&#34; (flutter/engine#6899)
b44b94e Roll src/third_party/skia 66b91e4afb88..def9bcecd994 (1 commits) (flutter/engine#6898)
25db6e0 Roll src/third_party/skia d017e5138c57..66b91e4afb88 (1 commits) (flutter/engine#6897)
fd0911c Guard the service protocol&#39;s global handlers list with a reader/writer lock (#6888) (flutter/engine#6895)
fffcce4 Roll src/third_party/skia 1bfdd1adfa22..d017e5138c57 (1 commits) (flutter/engine#6896)
a01c82e Roll src/third_party/skia 7e9ea391cfce..1bfdd1adfa22 (1 commits) (flutter/engine#6894)
9ba5561 Revert &#34;Guard the service protocol&#39;s global handlers list with a reader/writer lock (#6888)&#34; (flutter/engine#6893)
517e525 Roll src/third_party/skia 73b4a1f57254..7e9ea391cfce (1 commits) (flutter/engine#6892)
9352360 Guard the service protocol&#39;s global handlers list with a reader/writer lock (flutter/engine#6888)
9296d80 Roll src/third_party/skia 7fb30f11a055..73b4a1f57254 (3 commits) (flutter/engine#6891)
93cbf60 Roll src/third_party/skia 281224020a57..7fb30f11a055 (1 commits) (flutter/engine#6889)
aa9793f Roll src/third_party/skia a2187bf7629a..281224020a57 (5 commits) (flutter/engine#6887)
3978f07 Keep a copy of each engine&#39;s description that can be accessed outside the engine&#39;s UI thread (flutter/engine#6885)
0870e37 Roll src/third_party/skia 3b155a77c370..a2187bf7629a (11 commits) (flutter/engine#6884)


The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/&#43;/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC&#39;d on the roll, and stop the roller if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants