diff options
author | Jamie Liu <jamieliu@google.com> | 2021-09-02 15:48:04 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-09-02 15:50:49 -0700 |
commit | 2aeab259c4d24f87d7788fed338b64d99e0865ec (patch) | |
tree | 3f42007a3d7a7d810ca9e3c8a2705b93682fd3d3 /pkg/p9 | |
parent | 9149b2cefdb5883e41416aecea16fba4c5cd3ac1 (diff) |
Internal change.
PiperOrigin-RevId: 394560866
Diffstat (limited to 'pkg/p9')
-rw-r--r-- | pkg/p9/client.go | 2 | ||||
-rw-r--r-- | pkg/p9/transport_flipcall.go | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pkg/p9/client.go b/pkg/p9/client.go index 764f1f970..eb496f02f 100644 --- a/pkg/p9/client.go +++ b/pkg/p9/client.go @@ -528,7 +528,7 @@ func (c *Client) sendRecvChannel(t message, r message) error { } // Send the request and receive the server's response. - rsz, err := ch.send(t) + rsz, err := ch.send(t, false /* isServer */) if err != nil { // See above. c.channelsMu.Lock() diff --git a/pkg/p9/transport_flipcall.go b/pkg/p9/transport_flipcall.go index 802254a90..69a9f2537 100644 --- a/pkg/p9/transport_flipcall.go +++ b/pkg/p9/transport_flipcall.go @@ -85,7 +85,7 @@ func (ch *channel) service(cs *connState) error { } r := cs.handle(m) msgRegistry.put(m) - rsz, err = ch.send(r) + rsz, err = ch.send(r, true /* isServer */) if err != nil { return err } @@ -122,7 +122,7 @@ func (ch *channel) Close() error { // // The return value is the size of the received response. Not that in the // server case, this is the size of the next request. -func (ch *channel) send(m message) (uint32, error) { +func (ch *channel) send(m message, isServer bool) (uint32, error) { if log.IsLogging(log.Debug) { log.Debugf("send [channel @%p] %s", ch, m.String()) } @@ -162,7 +162,11 @@ func (ch *channel) send(m message) (uint32, error) { } // Perform the one-shot communication. - return ch.data.SendRecv(ssz) + if isServer { + return ch.data.SendRecv(ssz) + } + // RPCs are expected to return quickly rather than block. + return ch.data.SendRecvFast(ssz) } // recv decodes a message that exists on the channel. |