stackvana / microcule

SDK and CLI for spawning streaming stateless HTTP microservices in multiple programming languages
Other
479 stars 29 forks source link

Removes usage of overloaded STDERR interface #41

Closed Marak closed 7 years ago

Marak commented 7 years ago

The original decision to use STDERR to pass JSON messages from child processes to the parent process has been somewhat problematic.

It was working well in previous cases before we added support for arbitrary binaries. Main issue is that it's valid for developers to use STDERR to display non-critical logging messages. We were previously treating any non-json output from STDERR as an actual error to be piped directly back to the client. This isn't ideal, as STDERR messages should always be sent to a separate logging endpoint. Related: #34

The breaking point for this came during testing of a new patch for hook.io which needs to call a well-known linux binary that consistently writes debugging information to STDERR.

This PR includes changes which move all JSON communication from child to parent process onto File Descriptor 3 ( which I believe is OK to do ).

@pyhedgehog - Could you please review the changes which were made to python and python-wsgi support? I think I've pretty much got it working again, but we may want to change some of the API semantics.

pyhedgehog commented 7 years ago

This change will break compatibility with all "old-style" python hooks.