omni / poa-bridge

POA <-> Ethereum bridge for self transfers of POA native token to POA20 (ERC20 representation). Not supported. Use TokenBridge instead
https://github.com/poanetwork/token-bridge
GNU General Public License v3.0
80 stars 39 forks source link

Problem: complexity associated with error handling #32

Closed yrashk closed 6 years ago

yrashk commented 6 years ago

Currently, bridge will try to handle errors in some way in order to attempt to restore its functionality.

However, this limits as to how the errors can be handled as every time a change in handling is needed, a patch for bridge will needed.

Overtime, this will inevitably grow into a full-fledged supervisor.

However, there are already supervisor programs out there (starting from all-encompassing systemd down to small supervision utilities)

Solution: revert the handling of errors to the old behaviour but (very importantly) make bridge return meaningful error codes for all known error types so that the supervisor can make a proper decision as to what has to be done (restart, delayed restart, permanent shutdown, notification, etc.)

akolotov commented 6 years ago

Does it mean that Linux is only the system where bridge can be run? Does it mean that even in a development environment when the bridge is run without systemd I need to handle "broken pipe" and other issues manually by restarting the bridge?

We opened the issue https://github.com/poanetwork/parity-bridge/issues/22 which caused the changes you are going to rollback just after observations in development environment.

Just would like to understand what is the scenario for development environment.

yrashk commented 6 years ago

Oh, absolutely not limited to Linux. Any kind of shell script, PowerShell, dedicated supervisor would do the job.

The intention for the development environment is to provide a simple shell script that'll do simple restarts (it'll be immediately more flexible for its users as you'd just need to alter the script to do different things depending on the error code if you need to)

akolotov commented 6 years ago

Since you are rolling back the changes as so the bridge will start relying on a third party tool, could you provide an example of such shell script in order to other developers (e.g. me and Roman) could use it in tests?

yrashk commented 6 years ago

Oh yes, of course. I just amended this PR to include such a script, as well as handle "intentional" shutdowns.