Skip to content

Commit f56b8fe

Browse files
authored
[r3.5] node/components/downloader: always register torrent client status on default mux (#21822)
Same fix as #21821, for release/3.5. The torrent client status endpoint (`/downloader/torrentClientStatus`) became unreachable via `GOPPROF=http` when `--metrics`/`--pprof` are off, after #20471 wrapped the registration call in `if p.debugMux != nil`. `HandleTorrentClientStatus` registers on `http.DefaultServeMux` unconditionally and nil-guards `debugMux` internally, so the guard only dropped the default-mux path. Call it unconditionally to restore documented behavior.
1 parent 4dfe2ea commit f56b8fe

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

node/components/downloader/provider.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@ func (p *Provider) initDownloader(ctx context.Context) (downloaderproto.Download
125125
}
126126
p.Downloader = d
127127

128-
if p.debugMux != nil {
129-
d.HandleTorrentClientStatus(p.debugMux)
130-
}
128+
// Always call: HandleTorrentClientStatus registers the status handler on
129+
// http.DefaultServeMux (reachable via GOPPROF=http) regardless of whether
130+
// debugMux is nil. Guarding on p.debugMux != nil drops the default-mux
131+
// registration when --metrics/--pprof are disabled.
132+
d.HandleTorrentClientStatus(p.debugMux)
131133

132134
bittorrentServer, err := dl.NewGrpcServer(d)
133135
if err != nil {

0 commit comments

Comments
 (0)