commit | e1319e3c1a11dd2bd3a385846bb82d35a11e165d | [log] [tgz] |
---|---|---|
author | Bogdan Caprita <caprita@google.com> | Wed Oct 21 11:11:47 2015 -0700 |
committer | Bogdan Caprita <caprita@google.com> | Wed Oct 21 11:11:47 2015 -0700 |
tree | e1b3e404e8186b879d7a472c20bebf21b57e49eb | |
parent | 03e6a4cc3c95189f563677c832bff9ac3dfe3cde [diff] |
services/device/deviced/internal/impl: rework how instance stops happen The motivation for the change was that apps (that have the restart policy set) would get restarted if they fail to stop cleanly (so if stopAppRemotely fails but the app exits -- either on its own or due to forceSuspend -- the reaper would immediately go ahead and restart it). Even if the app exits cleanly with a remote stop, there's still the chance of a race between the stopWatching call and the reaper running the poll loop and restarting the app. This CL does a few things: - tells the reaper to stop watching the app when we intend to kill it (to prevent future restarts) - adds logic to stop() to verify when the app process actually exited, and call forceSuspend only if it didn't. Also, Kill now returns an error iff the app process didn't die (and conversely, if Kill returns nil, the user can be confident that the app has died). The app transitions to state 'not running' iff the process died. - make forciblySuspend work even for instances not watched by the reaper - addresses a TODO in restartAppIfNecessary Change-Id: I7f946a5967b0f34be5213477438dafdae9e0d121
This repository contains a reference implementation of the Vanadium APIs.
Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.