Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions server/segment_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ var httpClient = &http.Client{
// transparently support HTTP/2 while maintaining the flexibility to use HTTP/1 by running
// with GODEBUG=http2client=0
ForceAttemptHTTP2: true,

// Close the underlying connection if unused; otherwise they hang open for a long time
IdleConnTimeout: 1 * time.Minute,
},
// Don't set a timeout here; pass a context to the request
}
Expand Down
4 changes: 4 additions & 0 deletions trickle/trickle_publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"log/slog"
"net/http"
"sync"
"time"
)

var StreamNotFoundErr = errors.New("stream not found")
Expand Down Expand Up @@ -291,6 +292,9 @@ func httpClient() *http.Client {
// DisableKeepAlives: true,
// ignore orch certs for now
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},

// Prevent old TCP connections from accumulating
IdleConnTimeout: 1 * time.Minute,
}}
}

Expand Down
Loading