From 69f247c34fca4aed51e522e8344aa53fde33ee59 Mon Sep 17 00:00:00 2001 From: Alessandro Arzilli Date: Thu, 29 Jan 2026 00:50:05 +0100 Subject: [PATCH] service/rpccommon: print error when we can't decode request body (#4247) Instead of shutting down the connection without doing saying anything we should print an error, send an error response and try to continue serving the connection. --- service/rpccommon/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service/rpccommon/server.go b/service/rpccommon/server.go index 24c71ef5..6f5eb025 100644 --- a/service/rpccommon/server.go +++ b/service/rpccommon/server.go @@ -238,7 +238,9 @@ func (s *ServerImpl) serveJSONCodec(conn io.ReadWriteCloser) { } // argv guaranteed to be a pointer now. if err = codec.ReadRequestBody(argv.Interface()); err != nil { - return + s.log.Errorf("can't read request body: %v", err) + s.sendResponse(sending, &req, &rpc.Response{}, nil, codec, fmt.Sprintf("malformed request body: %v", err)) + continue } if argIsValue { argv = argv.Elem()