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

Issue 910403002: Suspend (rather than shut down) the host upon policy errors. (Closed)

Created:
5 years, 10 months ago by Łukasz Anforowicz
Modified:
5 years, 10 months ago
Reviewers:
Sergey Ulanov, Wez
CC:
chromium-reviews, chromoting-reviews_chromium.org, Wez
Base URL:
https://chromium.googlesource.com/chromium/src.git@mistyped-policies
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Suspend (rather than shut down) the host upon policy errors. This changelist primarily changes HostProcess::OnPolicyError, so that it doesn't anymore shut down the host, but instead restarts the host and prevents the host from starting again until a valid policy has been read (the "preventing" functionality has already been present in the form of StartHostIfReady method for some time now). This changelist also simplifies HostSignalingManager's functionality related to sending host-offline-reason. Previously HostProcess was destroyed while HostSignalingManager was trying to send host-offline-reason. Things are simpler if HostProcess waits until HostSignalingManager sends host-offline-reason or times out. This synchronization is especially helpful when restarting the host (to avoid having to deal with an old HostSignalingManager from previous SendHostOfflineReason attempt, while we construct a new HostSignalingManager when starting a host after a reset). This changelist also introduces a separate host-offline-reason for policy errors (and updates WebApp resources strings to reflect that). Note that since we are not shutting down the host, we probably cannot use one of HostExitCodes as the host-offline-reason. Testing done: 1. On Linux manually introduce policy errors at startup, verify host doesn't start and sends host-offline-reason, fix errors, verify host starts, reintroduce errors, verify host suspends and sends host-offline-reason, fix errors, verify host starts again. 2. Verify WebApp UI shows correct tooltip text for the new host-offline-reason. BUG=455903 Committed: https://crrev.com/fecb18b781906729a0ae22fd82a6dc3fcc929355 Cr-Commit-Position: refs/heads/master@{#317708}

Patch Set 1 : #

Total comments: 24

Patch Set 2 : Addressed code review feedback from Wez. #

Total comments: 9

Patch Set 3 : Style tweaks in remoting_me2me_host.cc #

Total comments: 11

Patch Set 4 : Clean-up and readability improvements for state transitions. #

Total comments: 11

Patch Set 5 : s/HOST_INITIALIZING/HOST_STARTING/g #

Total comments: 14

Patch Set 6 : Addressed Sergey's code review feedback. #

Patch Set 7 : Rebasing... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+219 lines, -167 lines) Patch
M remoting/host/heartbeat_sender.h View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M remoting/host/host_signaling_manager.h View 1 5 chunks +17 lines, -38 lines 0 comments Download
M remoting/host/host_signaling_manager.cc View 4 chunks +14 lines, -42 lines 0 comments Download
M remoting/host/policy_watcher.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M remoting/host/remoting_me2me_host.cc View 1 2 3 4 5 16 chunks +168 lines, -84 lines 0 comments Download
M remoting/resources/remoting_strings.grd View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M remoting/webapp/crd/js/host_table_entry.js View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 25 (9 generated)
Łukasz Anforowicz
Sergey, could you please take a look? Wez, I've added you to CC in case ...
5 years, 10 months ago (2015-02-12 00:28:35 UTC) #3
Wez
https://codereview.chromium.org/910403002/diff/20001/remoting/host/host_signaling_manager.h File remoting/host/host_signaling_manager.h (right): https://codereview.chromium.org/910403002/diff/20001/remoting/host/host_signaling_manager.h#newcode51 remoting/host/host_signaling_manager.h:51: // destroyed nit: Missing punctuation at end of line. ...
5 years, 10 months ago (2015-02-12 02:51:25 UTC) #5
Łukasz Anforowicz
Thanks for the feedback Wez. I tried addressing it in patchset #2. Sergey - can ...
5 years, 10 months ago (2015-02-12 18:08:01 UTC) #6
Wez
One point I meant to make when I reviewed this; the HostSignallingManager now does little ...
5 years, 10 months ago (2015-02-12 20:54:26 UTC) #7
Wez
https://codereview.chromium.org/910403002/diff/20001/remoting/host/host_signaling_manager.h File remoting/host/host_signaling_manager.h (right): https://codereview.chromium.org/910403002/diff/20001/remoting/host/host_signaling_manager.h#newcode93 remoting/host/host_signaling_manager.h:93: base::ThreadChecker thread_checker_; On 2015/02/12 18:08:01, lukasza wrote: > On ...
5 years, 10 months ago (2015-02-12 21:07:07 UTC) #8
Łukasz Anforowicz
Thanks Wez. I replied and made some tweaks "inline" (where I also tried addressing your ...
5 years, 10 months ago (2015-02-12 22:51:13 UTC) #9
Sergey Ulanov
https://codereview.chromium.org/910403002/diff/60001/remoting/host/remoting_me2me_host.cc File remoting/host/remoting_me2me_host.cc (right): https://codereview.chromium.org/910403002/diff/60001/remoting/host/remoting_me2me_host.cc#newcode152 remoting/host/remoting_me2me_host.cc:152: const char kHostOfflineBecauseOfRestarting[] = "RESTARTING"; s/Because/Reason/ to match field ...
5 years, 10 months ago (2015-02-13 02:59:29 UTC) #10
Łukasz Anforowicz
Thanks for the feedback Sergey. I tried to respond by renaming HostState names + being ...
5 years, 10 months ago (2015-02-13 20:41:00 UTC) #12
Wez
This looks reasonable; I'll defer to Sergey to provide the final approval! https://codereview.chromium.org/910403002/diff/40001/remoting/resources/remoting_strings.grd File remoting/resources/remoting_strings.grd ...
5 years, 10 months ago (2015-02-14 00:49:15 UTC) #13
Łukasz Anforowicz
I renamed INITIALIZING to STARTING as suggested by Wez and kept the other changes (hopefully ...
5 years, 10 months ago (2015-02-17 21:02:27 UTC) #14
Sergey Ulanov
LGTM once my comments are addressed. https://codereview.chromium.org/910403002/diff/120001/remoting/host/remoting_me2me_host.cc File remoting/host/remoting_me2me_host.cc (right): https://codereview.chromium.org/910403002/diff/120001/remoting/host/remoting_me2me_host.cc#newcode203 remoting/host/remoting_me2me_host.cc:203: // 2) policy ...
5 years, 10 months ago (2015-02-18 00:28:32 UTC) #15
Łukasz Anforowicz
Thanks Sergey. https://codereview.chromium.org/910403002/diff/120001/remoting/host/remoting_me2me_host.cc File remoting/host/remoting_me2me_host.cc (right): https://codereview.chromium.org/910403002/diff/120001/remoting/host/remoting_me2me_host.cc#newcode203 remoting/host/remoting_me2me_host.cc:203: // 2) policy error puts the host ...
5 years, 10 months ago (2015-02-18 17:03:11 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/910403002/160001
5 years, 10 months ago (2015-02-23 21:33:17 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/910403002/160001
5 years, 10 months ago (2015-02-23 23:32:00 UTC) #23
commit-bot: I haz the power
Committed patchset #7 (id:160001)
5 years, 10 months ago (2015-02-24 01:04:26 UTC) #24
commit-bot: I haz the power
5 years, 10 months ago (2015-02-24 01:05:45 UTC) #25
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/fecb18b781906729a0ae22fd82a6dc3fcc929355
Cr-Commit-Position: refs/heads/master@{#317708}

Powered by Google App Engine
This is Rietveld 408576698