sapling/hgext
Jun Wu 21c6b8ac47 extutil: make runbgcommand Ctrl+C safe
Summary:
There is a user report that a command was strangely forked into 2 processes:

The blackbox looks like:

  .... (no other "commit" command around this time)
  2018/08/21 10:57:03 c00b (33973)> commit
  2018/08/21 10:58:59 c00b (34191)> sl
  2018/08/21 10:58:59 c00b (34159)> pythonhook-pretxncommit: hgext.checkmessagehook.checkcommitmessage finished in 0.00 seconds
  2018/08/21 10:58:59 7b7a (34159)> commit exited 0 after 116.00 seconds
  2018/08/21 10:58:59 c00b (34191)> sl exited 0 after 0.39 seconds
  2018/08/21 10:58:59 7b7a (33973)> commit exited -1 after 116.17 seconds

It appears that pid 34159 was a fork of pid 33973. The fork and the original
process both end and mess up with the transaction framework.

The user did pressed Ctrl+C.  Looking at the code, I suspect extutil suffers
a same issue that I fixed for upstream worker.py [1]. So let's fix extutil
too.

[1]: 3176378509

Reviewed By: singhsrb

Differential Revision: D9438093

fbshipit-source-id: 66d72d5d1d2be89f078f391eac9bd7b21b4c176c
2018-08-23 10:35:54 -07:00
..
absorb codemod: reformat rest of the code 2018-07-05 17:52:43 -07:00
commitcloud cloud sync: fix smartlog message for multiple checkouts 2018-08-23 06:34:53 -07:00
convert codemod: reformat rest of the code 2018-07-05 17:52:43 -07:00
extlib hg: rename pathencoding into encoding 2018-08-22 09:06:20 -07:00
fastannotate codemod: reformat rest of the code 2018-07-05 17:52:43 -07:00
fastmanifest lock: use flock on POSIX 2018-08-08 16:20:21 -07:00
fbamend hgext: use in-core revive API 2018-08-18 10:51:57 -07:00
fsmonitor racedetector: ignore ignored files 2018-08-01 12:21:29 -07:00
hgevents don't allow state-enter/leave event errors to block hg 2018-08-21 15:05:33 -07:00
hggit hggit: use transactions during git import 2018-08-07 18:07:08 -07:00
hgsubversion hgsubversion: use context manager for config override 2018-08-09 21:21:50 -07:00
highlight codemod: reformat rest of the code 2018-07-05 17:52:43 -07:00
infinitepush hgext: use in-core revive API 2018-08-18 10:51:57 -07:00
lfs lfs: add a config option to disable LFS object verification 2018-08-23 00:35:16 -07:00
p4fastimport p4syncimport - make it case insensitive to resist perforce casing 2018-07-10 11:35:47 -07:00
perfsuite codemod: reformat rest of the code 2018-07-05 17:52:43 -07:00
pushrebase verify LFS blobs were uploaded before push 2018-08-20 16:51:07 -07:00
remotefilelog loose files: packing loose files for local data 2018-08-20 04:34:48 -07:00
repogenerator repogenerator: allow starting rev to be configured 2018-05-31 12:33:26 -07:00
treemanifest remotefilelog: allow using rust historypacks 2018-08-17 09:39:36 -07:00
zeroconf codemod: reformat rest of the code 2018-07-05 17:52:43 -07:00
__init__.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
age.py revset: increase weights of predicates that use filter 2018-06-22 07:40:08 -07:00
amend.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
arcdiff.py arcdiff: add lastsubmitted revsetpredicate 2018-08-14 19:27:41 -07:00
automv.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
backups.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
blackbox.py blackbox: ignore more exception from dirstate 2018-08-17 11:38:26 -07:00
bundle2hooks.py fb-hgext: move most of hgext3rd and related tests to core 2018-01-09 03:03:59 -08:00
catnotate.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
censor.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
checkmessagehook.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
children.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
chistedit.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
churn.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
cleanobsstore.py cleanobsstore: do not use unicode_literals 2018-08-09 21:21:52 -07:00
clienttelemetry.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
clindex.pyx codemod: use byte strings in cython files 2018-07-26 09:53:23 -07:00
clonebundles.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
commitextras.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
configwarn.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
conflictinfo.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
copytrace.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
crdump.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
debugcommitmessage.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
debuginhibit.py fb-hgext: move most of hgext3rd and related tests to core 2018-01-09 03:03:59 -08:00
debugshell.py debugshell: import more modules 2018-07-25 17:21:03 -07:00
dialect.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
directaccess.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
dirsync.py dirsync: do not crash rebase when cwd goes missing 2018-07-30 08:05:07 -07:00
drop.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
edrecord.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
eol.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
errorredirect.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
extdiff.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
extorder.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
extutil.py extutil: make runbgcommand Ctrl+C safe 2018-08-23 10:35:54 -07:00
factotum.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
fastlog.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
fastpartialmatch.py clindex: disable conflicting features 2018-07-25 08:34:55 -07:00
fbconduit.py revset: increase weights of predicates that use filter 2018-06-22 07:40:08 -07:00
fbhistedit.py rebase: use command-level template (BC) 2018-06-06 15:43:25 -07:00
fbshow.py fbshow: do not pass non-string config name to ui.setconfig 2018-08-09 21:21:51 -07:00
fbsparse.py sparse: add a progress bar applying sparse matcher 2018-08-17 11:38:27 -07:00
fetch.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
fixcorrupt.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
generic_bisect.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
githelp.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
gitlookup.py gitlookup: try to improve corner case handling 2018-08-15 12:07:49 -07:00
gitrevset.py gitlookup: try to improve corner case handling 2018-08-15 12:07:49 -07:00
globalrevs.py globalrevs: allow specifying custom repository name for globalrevs 2018-08-16 16:21:25 -07:00
gpg.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
graphlog.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
grepdiff.py revset: increase weights of predicates that use filter 2018-06-22 07:40:08 -07:00
grpcheck.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
hgk.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
hgsql.py hgsql: use with context for locking and config overrides 2018-08-09 21:21:50 -07:00
hiddenerror.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
histedit.py histedit: do not always use real strip on --abort 2018-08-20 18:35:56 -07:00
infinitepushbackup.py lock: rename remaining e.locker to e.lockinfo 2018-08-13 15:06:56 -07:00
inhibit.py obsolete: move commit reviving logic to core 2018-08-18 10:51:56 -07:00
inhibitwarn.py fb-hgext: move most of hgext3rd and related tests to core 2018-01-09 03:03:59 -08:00
interactiveui.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
journal.py lock: rename remaining e.locker to e.lockinfo 2018-08-13 15:06:56 -07:00
linkrevcache.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
logginghelper.py logginghelper: log what dirstate is being used 2018-08-15 14:50:37 -07:00
logtoprocess.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
lz4revlog.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
mergedriver.py mergedriver: fix the invalidation flakiness by setting sys.dont_write_bytecode 2018-06-29 10:47:38 -07:00
morecolors.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
morestatus.py tests: fix legitimate test-check-code.t failures 2018-07-02 23:50:56 -07:00
myparent.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
nointerrupt.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
obsshelve.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
ownercheck.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
pager.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
patchbomb.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
patchrmdir.pyx codemod: use byte strings in cython files 2018-07-26 09:53:23 -07:00
perftweaks.py clindex: disable conflicting features 2018-07-25 08:34:55 -07:00
phabdiff.py phabdiff: fix empty reviewers template 2018-06-22 15:50:39 -07:00
phabstatus.py tests: fix legitimate test-check-code.t failures 2018-07-02 23:50:56 -07:00
phrevset.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
progressfile.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
pullcreatemarkers.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
purge.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
rage.py rage: use pager 2018-08-22 21:35:21 -07:00
rebase.py rebase: do not always use real strip on --abort 2018-08-18 10:51:57 -07:00
record.py mq: remove the extension 2018-07-30 08:49:26 -07:00
releasenotes.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
relink.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
remoteid.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
remotenames.py disable fastheaddiscovery during push 2018-07-24 00:35:44 -07:00
reset.py hgext: use in-core revive API 2018-08-18 10:51:57 -07:00
sampling.py sampling: add support for environment variables to be logged as metrics 2018-07-11 21:09:32 -07:00
schemes.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
share.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
shareutil.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
shelve.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
show.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
sigtrace.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
simplecache.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
smartlog.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
sparse.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
sshaskpass.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
stat.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
strip.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
traceprof.pyx codemod: use byte strings in cython files 2018-07-26 09:53:23 -07:00
transplant.py Upgrade to 18.5b1 2018-05-30 02:23:58 -07:00
treedirstate.py treedirstate: avoid calling None.clear in clear() 2018-07-06 19:20:24 -07:00
tweakdefaults.py histedit: do not always use real strip on --abort 2018-08-20 18:35:56 -07:00
uncommit.py uncommit: fix "restoring deletion" case for treestate 2018-08-13 08:35:43 -07:00
undo.py undo: show a hint when a user might have wanted uncommit or unamend 2018-08-22 03:50:55 -07:00
upgradegeneraldelta.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
whereami.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
win32mbcs.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00
win32text.py codemod: join the auto-formatter party 2018-05-25 22:17:29 -07:00