summaryrefslogtreecommitdiffhomepage
path: root/pkg/p9
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-09-02 22:54:43 +0000
committergVisor bot <gvisor-bot@google.com>2021-09-02 22:54:43 +0000
commitf1555bdddeef28855b188e129a9210046fb2870f (patch)
treeded1f61c5d3f33d1aa492c50808d63382b97bdff /pkg/p9
parent2eebe530c712729af7866de15e3d6434d524f034 (diff)
parent2aeab259c4d24f87d7788fed338b64d99e0865ec (diff)
Merge release-20210823.0-49-g2aeab259c (automated)
Diffstat (limited to 'pkg/p9')
-rw-r--r--pkg/p9/client.go2
-rw-r--r--pkg/p9/transport_flipcall.go10
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.