Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Issue 2207153004: Fixing a hang in the native messaging hosts on Windows (Closed)

Created:
4 years, 4 months ago by joedow
Modified:
4 years, 4 months ago
Reviewers:
Sergey Ulanov
CC:
chromium-reviews, chromoting-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixing a hang in the native messaging hosts on Windows The It2Me and Me2Me native messaging host processes would hang after reporting an error and attempting to terminate the process. This appeared to be caused by the NativeMessageReader component which was blocked on a read operation on one thread while another thread was waiting for it to exit. The fix is to use a Windows API to cancel synchronous IO on the blocked thread and then destroying the inner message reader class. Also, we should treat an elevate request cancellation the same as a failure to launch the elevated process. The binary cannot accomplish its task either way so there isn't any benefit to treating them differently, it's better to allow the caller to decide what to do in that case (restart the NMH or send another message to it). BUG=634218 Committed: https://crrev.com/0edf3b33e71c5cd32e6fe02497ee4f17152a9772 Cr-Commit-Position: refs/heads/master@{#411125}

Patch Set 1 #

Patch Set 2 : Merging with ToT #

Patch Set 3 : Fixed a problem where member variables were being dereferenced after OnError() was called. #

Patch Set 4 : Preventing error logging for expected/ok error condition #

Total comments: 2

Patch Set 5 : Updating unit tests #

Patch Set 6 : Fixing posix unittest failures #

Patch Set 7 : Adding a comment describing why we need to cancel the pending read operation on Windows. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+157 lines, -54 lines) Patch
M remoting/host/native_messaging/native_messaging_reader.cc View 1 2 3 4 5 6 4 chunks +36 lines, -4 lines 0 comments Download
M remoting/host/native_messaging/native_messaging_reader_unittest.cc View 1 2 3 4 5 5 chunks +111 lines, -42 lines 0 comments Download
M remoting/host/setup/me2me_native_messaging_host.cc View 1 2 6 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 41 (33 generated)
joedow
PTAL!
4 years, 4 months ago (2016-08-08 23:42:27 UTC) #17
Sergey Ulanov
Can you please add a unittest for this case? https://codereview.chromium.org/2207153004/diff/60001/remoting/host/native_messaging/native_messaging_reader.cc File remoting/host/native_messaging/native_messaging_reader.cc (right): https://codereview.chromium.org/2207153004/diff/60001/remoting/host/native_messaging/native_messaging_reader.cc#newcode147 remoting/host/native_messaging/native_messaging_reader.cc:147: ...
4 years, 4 months ago (2016-08-09 15:39:58 UTC) #20
joedow
Added a unit test for the new scenario (also refactored and cleaned up the existing ...
4 years, 4 months ago (2016-08-10 02:49:58 UTC) #29
Sergey Ulanov
I don't see a good reason to implement the same fix for posix. Maybe add ...
4 years, 4 months ago (2016-08-10 15:23:40 UTC) #30
joedow
Added a comment block in the d'tor. Thanks!
4 years, 4 months ago (2016-08-10 19:17:44 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2207153004/120001
4 years, 4 months ago (2016-08-10 20:04:15 UTC) #38
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 4 months ago (2016-08-10 20:09:22 UTC) #39
commit-bot: I haz the power
4 years, 4 months ago (2016-08-10 20:10:58 UTC) #41
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/0edf3b33e71c5cd32e6fe02497ee4f17152a9772
Cr-Commit-Position: refs/heads/master@{#411125}

Powered by Google App Engine
This is Rietveld 408576698