diff --git a/packer/rpc/communicator.go b/packer/rpc/communicator.go index 857b92277..b16c94e6f 100644 --- a/packer/rpc/communicator.go +++ b/packer/rpc/communicator.go @@ -222,6 +222,10 @@ func serveSingleCopy(name string, l net.Listener, dst io.Writer, src io.Reader) return } + // Be sure to close the connection after we're done copying so + // that an EOF will successfully be sent to the remote side + defer conn.Close() + // The connection is the destination/source that is nil if dst == nil { dst = conn