Merge pull request #701 from mitchellh/rpc-refactor
RPC happens over single TCP connection per plugin now Three benefits: * Single file descriptor per plugin * NAT-friendly since plugins don't have to dial back in to the host * Opens the foundation that we can easily use Unix domain sockets and such A handful of Packer users were having issues with highly parallel (many builder/provisioner) templates where their systems would quickly reach their default file descriptor limits. This was because the previous mechanism would use a single TCP connection per RPC server, and Packer needs many (one per interface, basically). This merges in a MuxConn that multiplexes many "streams" on top of a single io.ReadWriteCloser. The RPC system has been revamped to know about this and use unique stream IDs to send everything over a single connection per plugin. Previously, the RPC mechanism would sometimes send an address to the remote end and expect the remote end to connect back to it. While Packer shouldn't run remotely, some firewalls were having issues. This should be gone. Finally, it should be possible now to optimize and use Unix domain sockets on Unix systems, avoiding ports and firewalls altogether.
Showing
packer/rpc/client.go
0 → 100644
packer/rpc/client_test.go
0 → 100644
packer/rpc/muxconn.go
0 → 100644
packer/rpc/muxconn_test.go
0 → 100644
Please register or sign in to comment