mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Prevent lisafs socket communicator from returning io.EOF when server exits.
This is consistent with what our p9 package does. See pkg/p9/client.go:sendRecvLegacySyscallErr(). This is also consistent with what lisafs channel communicator does. We log the actual error that caused the RPC to fail and map all transport errors to EIO. Returning io.EOF to the client may cause the sentry to panic if it tries to convert it into a syscall error in kernel.ExtractErrno(). PiperOrigin-RevId: 495696116
This commit is contained in:
@@ -74,7 +74,7 @@ func (ch *channel) SndRcvMessage(m MID, payloadLen uint32, wantFDs uint8) (MID,
|
||||
// This channel is now unusable.
|
||||
ch.dead = true
|
||||
// Map the transport errors to EIO, but also log the real error.
|
||||
log.Warningf("lisafs.sndRcvMessage: flipcall.Endpoint.SendRecv: %v", err)
|
||||
log.Warningf("channel.SndRcvMessage: flipcall.Endpoint.SendRecv failed: %v", err)
|
||||
return 0, 0, unix.EIO
|
||||
}
|
||||
|
||||
|
||||
+9
-2
@@ -83,11 +83,18 @@ func (s *sockCommunicator) PayloadBuf(size uint32) []byte {
|
||||
|
||||
// SndRcvMessage implements Communicator.SndRcvMessage.
|
||||
func (s *sockCommunicator) SndRcvMessage(m MID, payloadLen uint32, wantFDs uint8) (MID, uint32, error) {
|
||||
// Map the transport errors to EIO, but also log the real error.
|
||||
if err := s.sndPrepopulatedMsg(m, payloadLen, nil); err != nil {
|
||||
return 0, 0, err
|
||||
log.Warningf("socketCommunicator.SndRcvMessage: sndPrepopulatedMsg failed: %v", err)
|
||||
return 0, 0, unix.EIO
|
||||
}
|
||||
|
||||
return s.rcvMsg(wantFDs)
|
||||
respM, respPayloadLen, err := s.rcvMsg(wantFDs)
|
||||
if err != nil {
|
||||
log.Warningf("socketCommunicator.SndRcvMessage: rcvMsg failed: %v", err)
|
||||
return 0, 0, unix.EIO
|
||||
}
|
||||
return respM, respPayloadLen, nil
|
||||
}
|
||||
|
||||
// String implements fmt.Stringer.String.
|
||||
|
||||
Reference in New Issue
Block a user