project-receptor / python-receptor

Project Receptor is a flexible multi-service relayer with remote execution and orchestration capabilities linking controllers with executors across a mesh of nodes.
Other
32 stars 21 forks source link

Use EOF code field to indicate abnormal termination #135

Closed ghjm closed 4 years ago

ghjm commented 4 years ago

Currently, when a worker experiences an exception, we send a normal response message with the payload set to the text of the exception error message. This presents a problem for controllers: when they receive a response, they don't know if they should parse the payload as their own data format, or as a string containing an error message.

To solve this, this PR moves the error handling to the EOF message. The code field is used to indicate whether an error occurred (0=success). If an exception occurrs, the payload of the EOF message contains the error text.