Open tkang007 opened 6 years ago
Hey there - thanks for the suggestion! One challenge I can think of here is that it's hard to know what's the right amount of time to choose for everything. Maybe this would be better exposed as a configuration variable somewhere?
Hi,
How about adding timeout parameter when using subprocess methodss: check_output, check_run, check_call,... to avoid block forever at certain cases?
Especially, network related command could be block at various reason, such as proxy down,...
I think timeout value could be 10 times of usual elapsed time.
In my case, it was blocked until interrupting as below stack.
File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 113, in ensure_chp_package ], cwd=prefix, stderr=subprocess.STDOUT) File "/usr/lib/python3.6/subprocess.py", line 336, in check_output **kwargs).stdout File "/usr/lib/python3.6/subprocess.py", line 405, in run stdout, stderr = process.communicate(input, timeout=timeout) File "/usr/lib/python3.6/subprocess.py", line 830, in communicate stdout = self.stdout.read()