Bugfix/grpc consume eof (#912)

* GRPC streams end with an EOF

The client should ensure that the final packet is followed by a GRPC
EOF. This has the benefit of permitting the client code to clean up resources.

* Don't require an entire HTTP request in RunnerCall

TryExec needs a handle on an incoming ReadCloser containing the body
of a request; however, everything else will already have been extracted
from the HTTP request in the case of lbAgent use.

(The point of this change is to simplify the interface for other uses.)

* Return error from GRPC layer explicitly

As per review
This commit is contained in:
jan grant
2018-04-03 15:04:21 +01:00
committed by GitHub
parent 3c536d1e01
commit 88074a42c0
4 changed files with 15 additions and 7 deletions

View File

@@ -128,15 +128,18 @@ func (c *mockRunnerCall) SlotDeadline() time.Time {
return c.slotDeadline
}
func (c *mockRunnerCall) Request() *http.Request {
return c.r
func (c *mockRunnerCall) RequestBody() io.ReadCloser {
return c.r.Body
}
func (c *mockRunnerCall) ResponseWriter() http.ResponseWriter {
return c.rw
}
func (c *mockRunnerCall) StdErr() io.ReadWriteCloser {
return c.stdErr
}
func (c *mockRunnerCall) Model() *models.Call {
return c.model
}