veyron/runtimes/google/ipc: Make it an error to pass a nil context to StartCall.
Change-Id: Id708a0aa8844f9ea6332256fc20653bd33a89837
diff --git a/runtimes/google/ipc/client.go b/runtimes/google/ipc/client.go
index baedb01..3c90847 100644
--- a/runtimes/google/ipc/client.go
+++ b/runtimes/google/ipc/client.go
@@ -122,6 +122,10 @@
// startCall ensures StartCall always returns verror.E.
func (c *client) startCall(ctx context.T, name, method string, args []interface{}, opts ...ipc.CallOpt) (ipc.Call, verror.E) {
+ if ctx == nil {
+ return nil, verror.BadArgf("ipc: %s.%s called with nil context", name, method)
+ }
+
servers, err := c.mt.Resolve(ctx, name)
if err != nil {
return nil, verror.NotFoundf("ipc: Resolve(%q) failed: %v", name, err)
diff --git a/runtimes/google/lib/publisher/publisher.go b/runtimes/google/lib/publisher/publisher.go
index e86d232..517f7e2 100644
--- a/runtimes/google/lib/publisher/publisher.go
+++ b/runtimes/google/lib/publisher/publisher.go
@@ -200,6 +200,7 @@
func newPubState(ctx context.T, mt naming.MountTable, period time.Duration) *pubState {
return &pubState{
+ ctx: ctx,
mt: mt,
period: period,
deadline: time.Now().Add(period),