graceful shutdown in microdroid
This change allows the shutdown watchdog timeout to be arbitrarily small (ex: 2s) in Microdroid. Previously, this was set to 60 sec for both Android and Microdroid. Microdroid however actually wasn't affected by this because it never implemented graceful shutdown. Now, Microdroid tries to gracefully shutdown whenever it can. If a VM is no longer needed, instead of powering the cable off (by killing the crosvm process), we now send a command to Microdroid to initiate a shutdown sequence by setting sys.shhutdown.requested. On the Android side, if the complete shutdown is not observed withint 5 seconds, it forcibly kills the VM, in which case data corruption may happen. Without this change, the voluntary shutdown happens only after 60 seconds, however, this is unnecessarily long for Microdroid. Unlike Android, it doesn't have big/many disks to sync. Only encrypted storage needs to be synced and this can be done faily quickly. To alleviate this, Microdroid additionally set the shutdown watchdog timeout to 2 seconds. And this change allows such a short timeout for Microdroid. Bug: 419607474 Flag: EXEMPT bug fix Test: see the other commit in the same topic Change-Id: I15553c3ca9cef80d7b3adc5690a151442a335408
Loading
Please register or sign in to comment