burke / zeus

Boot any rails app in under a second.
MIT License
3.33k stars 231 forks source link

Refactor Zeus' process interface #591

Closed metcalf closed 7 years ago

metcalf commented 8 years ago

Refactor Zeus' core process management

This encapsulates all of the code for communicating directly with Zeus' node processes into a process package. That's now the only package that speaks over a unix socket to node processes. The eventual goal is to completely replace the processtree package with something more robust. This incremental step places a lot of complexity inside a testable unit and should resolve at least a few race conditions.

In order to accomplish this, I changed how node processes communicate back to Zeus. Previously, when a new node started up it always communicated using a single master socket. It now communicates using its parent's command socket (which is actually how commands work already).

metcalf commented 7 years ago

@zenazn: I've added documentation to the public interface of the new processtree/process package. This should be ready for review but please tell me if there are things you'd like me to do to make it more reviewable.

If this lands, I'll have two other pieces that follow up almost immediately. The first will wrap communication with command processes in a CommandProcess type akin to NodeProcess so that nothing passes sockets around. The second will refactor ProcessTree and SlaveNode to expose a cleaner, narrower interface to the rest of Zeus.

metcalf commented 7 years ago

The Travis failures are happening on all branches. I'm going to investigate separately.

metcalf commented 7 years ago

Closing for now, given the major issues with Zeus' current file monitoring system I'm going to have to rethink a bit.