jubatus/jubatus — pull request #782 by kmaehashi (2014-05-14 09:35:02+00:00)
Title: Improve push_mixer RPC error handling

`push_mixer` does not handle connection errors, so it does not contain server/port actually failed, which prohibits the logging policy.

The same problem for `linear_mixer` was reported in #729.

Before applying this patch:

```
W0514 16:28:45.399148 31704 push_mixer.cpp:326] std::bad_cast : mix failed
```

After applying this patch:

```
W0514 17:01:20.046917 875 push_mixer.cpp:162] pull failed at 192.168.122.211:9199 : connect failed
I0514 17:01:20.046974 875 push_mixer.cpp:385] 9.01344 time elapsed 0 pulled 0 pushed
```

Here's the summary of what I did:

* Move `create_error_string` function, which converts errors occured in `rpc_mclient` into string, from `linear_mixer` to `rpc_mclient`.
This function is called both from `linear_mixer` and `push_mixer`.
* Add `handle_communication_error` function to `push_mixer`.
This function checks the RPC errors occured in `push_mixer` RPCs (`pull`, `get_pull_argument` and `push`)
* Adjust the interface to go with the fix above.