Skip to content
Merged
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
Next Next commit
Go: RPC client loop expects stdout close
  • Loading branch information
chlowell committed Feb 28, 2026
commit ced33cb53deac2ef9edd5aada0f1fcbfb85ec509
4 changes: 3 additions & 1 deletion go/internal/jsonrpc2/jsonrpc2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import (
"bufio"
"crypto/rand"
"encoding/json"
"errors"
"fmt"
"io"
"os"
"reflect"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -306,7 +308,7 @@ func (c *Client) readLoop() {
line, err := reader.ReadString('\n')
if err != nil {
// Only log unexpected errors (not EOF or closed pipe during shutdown)
if err != io.EOF && c.running.Load() {
if err != io.EOF && !errors.Is(err, os.ErrClosed) && c.running.Load() {
fmt.Printf("Error reading header: %v\n", err)
}
return
Comment thread
chlowell marked this conversation as resolved.
Expand Down
Loading