This is an archive of the discontinued Mercurial Phabricator instance.

showstack: also handle SIGALRM
ClosedPublic

Authored by durin42 on Oct 3 2018, 4:13 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Commits
rHGacf5dbe39478: showstack: also handle SIGALRM
Summary

This is looking *very* handy when debugging mysterious hangs in a
test: you can wrap a hanging invocation in

`perl -e 'alarm shift @ARGV; exec @ARGV' 1`

for example, a hanging hg pull becomes

`perl -e 'alarm shift @ARGV; exec @ARGV' 1 hg pull`

where the 1 is the timeout in seconds before the process will be hit
with SIGALRM. After making that edit to the test file, you can then
use --extra-config-opt on run-tests.py to globaly enable showstack
during the test run, so you'll get full stack traces as you force your
hg to exit.

I wonder (but only a little, not enough to take action just yet) if we
should wire up some scaffolding in run-tests itself to automatically
wrap all commands in alarm(3) somehow to avoid hangs in the future?

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

durin42 created this revision.Oct 3 2018, 4:13 PM
This revision was automatically updated to reflect the committed changes.