mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 20:12:07 +08:00
* Fix waiting for unkillable process. Fixes #1087 * Add bugfix to release notes * Don't pass in exitcode old-commit-hash: 909efef6af6d8d396ea9c8e1122455231a062682
This commit is contained in:
@@ -3,6 +3,7 @@ Version 0.7.3 (2020-xx-xx)
|
||||
* Support for 2020 Highlander thanks to che220!
|
||||
* Support for 2018 Lexus NX 300h thanks to kengggg!
|
||||
* Speed up ECU firmware query
|
||||
* Fix bug where manager would sometimes hang after shutting down the car
|
||||
|
||||
Version 0.7.2 (2020-02-07)
|
||||
========================
|
||||
|
||||
+11
-8
@@ -289,6 +289,15 @@ def prepare_managed_process(p):
|
||||
subprocess.check_call(["make", "clean"], cwd=os.path.join(BASEDIR, proc[0]))
|
||||
subprocess.check_call(["make", "-j4"], cwd=os.path.join(BASEDIR, proc[0]))
|
||||
|
||||
|
||||
def join_process(process, timeout):
|
||||
# Process().join(timeout) will hang due to a python 3 bug: https://bugs.python.org/issue28382
|
||||
# We have to poll the exitcode instead
|
||||
t = time.time()
|
||||
while time.time() - t < timeout and process.exitcode is None:
|
||||
time.sleep(0.001)
|
||||
|
||||
|
||||
def kill_managed_process(name):
|
||||
if name not in running or name not in managed_processes:
|
||||
return
|
||||
@@ -302,18 +311,12 @@ def kill_managed_process(name):
|
||||
else:
|
||||
running[name].terminate()
|
||||
|
||||
# Process().join(timeout) will hang due to a python 3 bug: https://bugs.python.org/issue28382
|
||||
# We have to poll the exitcode instead
|
||||
# running[name].join(5.0)
|
||||
|
||||
t = time.time()
|
||||
while time.time() - t < 5 and running[name].exitcode is None:
|
||||
time.sleep(0.001)
|
||||
join_process(running[name], 5)
|
||||
|
||||
if running[name].exitcode is None:
|
||||
if name in unkillable_processes:
|
||||
cloudlog.critical("unkillable process %s failed to exit! rebooting in 15 if it doesn't die" % name)
|
||||
running[name].join(15.0)
|
||||
join_process(running[name], 15)
|
||||
if running[name].exitcode is None:
|
||||
cloudlog.critical("FORCE REBOOTING PHONE!")
|
||||
os.system("date >> /sdcard/unkillable_reboot")
|
||||
|
||||
Reference in New Issue
Block a user