bisect-kit: mitigate "repo sync" hang problem

1. Set repo sync timeout limit. When it happens, it will re-init the
   repository and sync again.
2. kill previous left "repo_launcher" subprocesses, which may hang new
   "repo sync" command.
3. The output of "repo sync" may return non-UTF8 chars. Turn the popen
   call into binary mode to avoid decode() error.
4. Handle util.Popen reader thread exceptions gracefully.

BUG=b:332200004 sync && &&

Change-Id: I331354f708aff8879f2b2df0e65b075fd9459566
Reviewed-by: MD Nayeem Jahan Rafi <>
Commit-Queue: Cheng-Yu Lee <>
Tested-by: Cheng-Yu Lee <>
2 files changed