ser...@chromium.org
unread,Nov 20, 2012, 3:02:34 PM11/20/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to alex...@chromium.org, w...@chromium.org, chromium...@chromium.org, jamiewal...@chromium.org, dcaiaf...@chromium.org, simonmor...@chromium.org, hclam...@chromium.org, wez+...@chromium.org, am...@chromium.org, sanj...@chromium.org, garyka...@chromium.org, lambroslam...@chromium.org, rmsous...@chromium.org, alexeyp...@chromium.org, sergey...@chromium.org
We don't really need Starting state because host startup is synchronous
- we can go from STOPPED to STARTED state in one step. Shutdown is
asynchronous and that's why we need STOPPING and RESTARTING states.
The reason we need BOOTSTRAPPING state is because we can't start the
host when the host process is launched until we read policies. So
BOOTSTRAPPING means host is stopped but it should be started as soon as
we receive policies (see OnPolicyUpdate()). STOPPED means that it's
stopped and should not be started unless config changes. You suggested
to transition from STARTED to STARTING when restarting, but that doesn't
really make sense - when restarting a host we need to stop it
asynchronously and then start it again synchronously, so the state will
be set to STARTING, while the old |host_| is being stopped.
On 2012/11/20 17:00:56, alexeypa wrote:
> bootstrapping and restarting states are confusing. I'd aim for the
following
> states:
> stopped,
> starting,
> started,
> stopping
> ... and the transitions:
> stopped -> starting
> starting-> started
> starting-> stopping (something like a bad config file)
> starting-> stopped (error handling)
> started -> starting (restart)
> started -> stopping
> stopping -> stopped
https://codereview.chromium.org/11416093/diff/4001/remoting/host/remoting_me2me_host.cc#newcode179
remoting/host/remoting_me2me_host.cc:179: HOST_BOOTSTRAPPING,
On 2012/11/20 03:44:19, Wez wrote:
> nit: HOST_STARTING
STARTING doesn't make sense because host can be started synchronously.
BOOTSTRAPPING is different from STARTING because we never return to that
state. It's used only once while we still waiting for the policies to be
read. Maybe rename it to WAITING_POLICIES?
On 2012/11/20 03:44:19, Wez wrote:
> Could this re-use HOST_STARTING, and we allow STARTING->STOPPING?
See my comments above.
On 2012/11/20 17:00:56, alexeypa wrote:
> nit: RESTARTING->STARTED is missing
Done.
On 2012/11/20 03:44:19, Wez wrote:
> nit: ShutdownHost -> Shutdown - this doesn't just shutdown the host,
it shuts
> down the hold process.
See my previous comments about not shutting down the whole process in
the future.
https://codereview.chromium.org/11416093/