sapling/hgcli
Stanislau Hlebik 4973890d63 mononoke: fix hgcli connection error in case of failures
Summary:
We've had this problem for almost a year now, and I've finally made some
progress.

The problem was in tests failing randomly with error like

```
-  remote: * pushrebase failed * (glob)
-  remote:     msg: "pushrebase failed Conflicts([PushrebaseConflict { left: MPath(\"1\"), right: MPath(\"1\") }])"
+  remote: Jan 25 08:46:24.067 ERRO Error in hgcli proxy, error: Connection reset by peer (os error 104), root_cause: Os {
+  remote:     code: 104,
+  remote:     kind: ConnectionReset,
+  remote:     message: "Connection reset by peer"
   remote: * backtrace* (glob)
```

or

```
   remote: * pushrebase failed * (glob)
   remote:     msg: "pushrebase failed Conflicts([PushrebaseConflict { left: MPath(\"1\"), right: MPath(\"1\") }])"
+  remote: Jan 25 08:47:59.966 ERRO Error in hgcli proxy, error: Connection reset by peer (os error 104), root_cause: Os {
+  remote:     code: 104,
+  remote:     kind: ConnectionReset,
+  remote:     message: "Connection reset by peer"
+  remote: }, backtrace:
```

note that the problem are slightly different. In the first case the actual error message is completely lost + we get unnecessary
ConnectionReset problem message. In the second case it's just `ConnectionReset`.

This diff fixes the problem of the lost error message (problem #1) and hides `ConnectionReset` problem (problem #2).

Problem #1 was due to a bug in streamfork. Before this diff if streamfork hit
an error, then it might have not sent already received input to one of the
outputs. This diff fixes it.

This diff just hides Problem #2. If we see a ConnectionReset then an error
won't be reported. That's a hack which should be fixed, but at the moment
a) The bug is not easily debuggable
b) The problem is not urgent and shouldn't cause problems

In some cases server actually sends Connection reset, but in that case
mercurial stil gives us self-explanatory message

```
abort: stream ended unexpectedly (got 0 bytes, expected 4
``

Reviewed By: lukaspiatkowski

Differential Revision: D13818558

fbshipit-source-id: 7a2cba8cd0fcef8211451df3dea558fe2d60fa60
2019-01-28 14:40:40 -08:00
..
src mononoke: fix hgcli connection error in case of failures 2019-01-28 14:40:40 -08:00
Cargo.toml Add Cargo.toml files to crates. (#7) 2018-07-09 19:52:27 -07:00
mononoke_ssh.sh hgcli: add a bash script for using mononoke deployed inside tupperware 2017-10-18 05:37:00 -07:00