This is an archive of the discontinued Mercurial Phabricator instance.

test: add test-transaction-rollback-on-sigpipe.t demonstrating py3 regression

Authored by mplamann on Oct 5 2020, 6:37 PM.



When an hg push is interrupted with C-c, the remote [hg serve] command
receives SIGPIPE.

If a pretxnchangegroup hook fails, the remote hg then tries to
rollback the transaction. It begins by printing "transaction
abort!\n". This returns EPIPE, but ignores that error.

In python3 (but not python2), this "transaction abort!\n" message
stays in a buffer, so future flushes of stderr will try to print the
message again, and so those flushes will also hit EPIPE.

This test demonstrates such a case where this EPIPE causes the
transaction rollback to fail, leaving behind an abandoned transaction.

Diff Detail

rHG Mercurial
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mplamann created this revision.Oct 5 2020, 6:37 PM
pulkit added a subscriber: pulkit.Oct 9 2020, 5:18 AM
pulkit added inline comments.

We use the hg build by in test suite.


I thought hg summary prints about abandoned transaction but I am not sure.

mplamann updated this revision to Diff 23206.Oct 14 2020, 12:33 PM
pulkit accepted this revision.Oct 16 2020, 3:31 AM
This revision is now accepted and ready to land.Oct 16 2020, 3:31 AM