HomePhabricator

worker: make windows workers daemons

Authored by wlis.

Description

worker: make windows workers daemons

The windows workers weren't daemons and were not correctly killed when ctrl-c'd from the terminal. Withi this change when the main thread is killed, all daemons get killed as well.
I also reduced the time we give to workers to cleanup nicely to not have people ctrl-c'ing when they get inpatient.

The output when threads clened up nicely:

PS C:\<dir>> hg.exe sparse --disable-profile SparseProfiles/<profile>.sparse
interrupted!

The output when threads don't clenup in 1 sec:

PS C:\<dir> hg.exe sparse --enable-profile SparseProfiles/<profile>.sparse
failed to kill worker threads while handling an exception
interrupted!
Exception in thread Thread-4 (most likely raised during interpreter shutdown):
PS C:\<dir>>

Test Plan:
Run hg command on windows (pull/update/sparse). Ctrl-C'd sparse --enable-profile command that was using threads and observed in proces explorer that all threads got killed.
ran tests on CentOS

Differential Revision: https://phab.mercurial-scm.org/D1564

Details

Committed
wlisNov 30 2017, 7:01 PM
Differential Revision
D1564: worker: make windows workers daemons
Parents
rHG9b7ee7b78856: workers: add config to enable/diable workers
Branches
Unknown
Tags
Unknown