( )⚙ D11087 sigpipe-remote: simply delegate pipe forwarding to subprocess we can kill

This is an archive of the discontinued Mercurial Phabricator instance.

sigpipe-remote: simply delegate pipe forwarding to subprocess we can kill
ClosedPublic

Authored by marmoute on Jul 12 2021, 12:02 AM.

Details

Summary

Instead of using sophisticated logics with thread a non blocking pipes, we
simply spawn two new process in charge of reading the pipe and sending the
result to the client. When it is time to cut the pipe we violently kill them
without any remorse. This close the pipe regardless of any in progress os.read
call.

Ironically this is the very same things as what the initial shell setup was
doing, but in Python.

This makes the test pass run properly on Windows. This also reveal that the
Windows behavior is broken as the transaction is not properly rollback. However
this is an adventure for another time. Making the test behave properly was
enough effort.

Diff Detail

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

Event Timeline

marmoute created this revision.Jul 12 2021, 12:02 AM
Alphare accepted this revision.Jul 13 2021, 11:34 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
tests/test-transaction-rollback-on-sigpipe.t
37

nit: flaky (and yes I will point it out every time :D)

This revision is now accepted and ready to land.Jul 13 2021, 11:34 AM