ipc: fix the race condition in client.createFlow caling manager.Dial.
Change-Id: I0d2e3be70f48c86522b89ea36cd5d7becfaafe37
diff --git a/runtimes/google/ipc/client.go b/runtimes/google/ipc/client.go
index 15d20ef..2121314 100644
--- a/runtimes/google/ipc/client.go
+++ b/runtimes/google/ipc/client.go
@@ -106,8 +106,10 @@
delete(c.vcMap, ep.String())
}
sm := c.streamMgr
+ vcOpts := make([]stream.VCOpt, len(c.vcOpts))
+ copy(vcOpts, c.vcOpts)
c.vcMapMu.Unlock()
- vc, err := sm.Dial(ep, c.vcOpts...)
+ vc, err := sm.Dial(ep, vcOpts...)
c.vcMapMu.Lock()
if err != nil {
return nil, err