Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: address context lint review findings
  • Loading branch information
XnLemon committed Jul 31, 2026
commit 64fdc75028f152d80ed24b90d147f1f7c55e8314
3 changes: 2 additions & 1 deletion protocol/jsonrpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ func (s *Server) handlePkg(conn net.Conn) {
conn.LocalAddr(), conn.RemoteAddr(), r, string(debug.Stack()))
}

connectionCancel()
conn.Close()
requestWG.Wait()
}()
// Register this after the cleanup defer so LIFO ordering cancels request contexts before Wait.
defer connectionCancel()
Comment thread
XnLemon marked this conversation as resolved.
Resolved

setTimeout := func(conn net.Conn, timeout time.Duration) {
t := time.Time{}
Expand Down
6 changes: 3 additions & 3 deletions remoting/exchange_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type Client interface {
IsAvailable() bool
}

type contextClient interface {
type contextRequester interface {
RequestContext(ctx context.Context, request *Request, timeout time.Duration, response *PendingResponse) error
}

Expand Down Expand Up @@ -166,8 +166,8 @@ func (client *ExchangeClient) RequestContext(ctx context.Context, invocation *ba
}

func (client *ExchangeClient) requestContext(ctx context.Context, request *Request, timeout time.Duration, response *PendingResponse) error {
if contextAwareClient, ok := client.client.(contextClient); ok {
return contextAwareClient.RequestContext(ctx, request, timeout, response)
if requester, ok := client.client.(contextRequester); ok {
return requester.RequestContext(ctx, request, timeout, response)
}
return client.client.Request(request, timeout, response)
}
Expand Down
Loading