This is an archive of the discontinued Mercurial Phabricator instance.

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

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

Details

Summary

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 ui.py 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

Repository
rHG Mercurial
Branch
stable
Lint
No Linters Available
Unit
No Unit Test Coverage

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.
tests/test-transaction-rollback-on-sigpipe.t
4

We use the hg build by run-tests.py in test suite.

9

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