From baf24fbe840b2b9fd49636f49fd6fa42f39290b9 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 11 Jul 2024 11:43:41 +0200 Subject: pkg/rpcserver: debug executor stalls In some cases, the executor seems to be mysteriously silent when we were awaiting a reply. During pkg/runtest tests, give it 1 minute to prepare a reply, then try to request the current state and abort the connection. --- pkg/flatrpc/conn.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pkg/flatrpc') diff --git a/pkg/flatrpc/conn.go b/pkg/flatrpc/conn.go index 9d8d1ce59..56afdfca4 100644 --- a/pkg/flatrpc/conn.go +++ b/pkg/flatrpc/conn.go @@ -109,14 +109,16 @@ func Send[T sendMsg](c *Conn, msg T) error { return nil } +type RecvType[T any] interface { + UnPack() *T + flatbuffers.FlatBuffer +} + // Recv receives an RPC message. // The type T is supposed to be a pointer to a normal flatbuffers type (not ending with T, e.g. *ConnectRequestRaw). // Receiving should be done from a single goroutine, the received message is valid // only until the next Recv call (messages share the same underlying receive buffer). -func Recv[Raw interface { - UnPack() *T - flatbuffers.FlatBuffer -}, T any](c *Conn) (res *T, err0 error) { +func Recv[Raw RecvType[T], T any](c *Conn) (res *T, err0 error) { defer func() { if err1 := recover(); err1 != nil { if err2, ok := err1.(error); ok { -- cgit mrf-deployment