Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: bridge dies when Parity is stopped
Steps to reproduce: Run two Parity-based nodes responsible for Home and Foreign chains. Run bridge: RUST_LOG=info bridge --config ... --database .... Kill parity process responsible for Foreign chain. Expected results: The bridge handles gracefully death of Parity node: warns about the connection lose, shutdowns all operations (deposit_relay, withdraw_confirm and withdraw_relay) for a while, waits when the connection appears and runs all operations after that. Actual results: After killing Parity process the following appear in the terminal where the bridge is running: WARN:<unknown>: Unexpected IO error: Error { repr: Os { code: 32, message: "Broken pipe" } } No messages appear from withdraw_confirm and withdraw_relay. Then after some time (few seconds or few minutes) the following appear on the terminal and the bridge dies: Request eth_blockNumber timed out Solution: once "Broken pipe" error is caught, attempt to reconnect repeatedly with a pause of 1 second between attempts. When other errors are caught, simply restart the bridge, as there is no indication that the connection has been severed. Fixes omni#22
- Loading branch information