Bug 4594 - Exception during bundle2 hide all server side output
Summary: Exception during bundle2 hide all server side output
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 3.2
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-11 18:05 UTC by Pierre-Yves David
Modified: 2015-04-21 04:58 UTC (History)
2 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Yves David 2015-04-11 18:05 UTC
When an exception occurs server side, the server properly emit a bundle with the exception information for the client to handle it. However, it discard any prepared reply during the unbundle process. This throw away any output that happened server side.

This is expecially problematic when a hook reject a push, because that push have likely printed some details about the rejection.

(Also, we need a bundle2 component)
Comment 1 Pierre-Yves David 2015-04-11 18:13 UTC
The current idea is to salvage all output parts from the existing reply and add them to the generate reply.

Just appending the exception part to the already generated bundle is unrealistic. That reply can be full of part that rely on data to be commited. For example, a part generating a changegroup with changeset rebased during the transaction won't be able to be actually streamed once the transaction have been roll backed.
Comment 2 HG Bot 2015-04-16 18:46 UTC
Fixed by http://selenic.com/repo/hg/rev/a2ef1dc3b59b
Pierre-Yves David <pierre-yves.david@fb.com>
bundle2: flush output in a part in all cases

We want to preserve output even when the unbundling fails (eg: hook output). So
we must make sure that everything we have is flushed into the reply bundle.

(This is related to issue4594)

(please test the fix)
Comment 3 HG Bot 2015-04-16 21:47 UTC
Fixed by http://selenic.com/repo/hg/rev/2ec894582ea2
Pierre-Yves David <pierre-yves.david@fb.com>
bundle2: add a 'copy' method on parts

This is the first step in our quest for preserving the server output on error
(issue4594). We want to be able to copy the output parts from the aborted reply
into the exception bundle.

The function will be used in a later patch.

(please test the fix)
Comment 4 HG Bot 2015-04-16 21:47 UTC
Fixed by http://selenic.com/repo/hg/rev/21f2e8f48ae1
Pierre-Yves David <pierre-yves.david@fb.com>
bundle2: add a 'salvageoutput' method on bundle20

This method returns a copy of all 'output' parts added to the bundler.

This is the second step in our quest for preserving the server output on error
(issue4594). We want to be able to copy the output parts from the aborted reply
into the exception bundle.

The function will be used in a later patch.

(please test the fix)
Comment 5 HG Bot 2015-04-16 21:47 UTC
Fixed by http://selenic.com/repo/hg/rev/f9aa4cb8f2dd
Pierre-Yves David <pierre-yves.david@fb.com>
bundle2: store the salvaged output on the exception object

The re-handling of output is happening in some 'unbundle' callers. We have to
transmit the output information to this place so we stick it on the exception.

This is the third step in our quest for preserving the server output on error
(issue4594). We want to be able to copy the output part from the aborted reply
into the exception bundle.

(please test the fix)
Comment 6 HG Bot 2015-04-16 21:47 UTC
Fixed by http://selenic.com/repo/hg/rev/0c4d5e01b31f
Pierre-Yves David <pierre-yves.david@fb.com>
bundle2-wireproto: properly propagate the server output on error (issue4594)

In case of errors, output parts salvaged from the reply bundle are re-injected
into the bundle carrying the exception.

We still need to fix the situation for non-wireprotocol push.

(please test the fix)
Comment 7 HG Bot 2015-04-16 21:47 UTC
Fixed by http://selenic.com/repo/hg/rev/d99d7e3f5cda
Pierre-Yves David <pierre-yves.david@fb.com>
bundle2-localpeer: properly propagate the server output on error (issue4594)

In case of errors, output parts salvaged from the reply bundle need to be
processed for outputting their content. This concludes our quest for fixing
issue4594.

(please test the fix)