<!-- XE-11745 · [Minor] Handler `/metrics` menjalankan `preScrape` SEBELUM batas `MaxRequestsInFlight`, dan gauge readiness bisa terpotret sobek · testnet -->
*Markdown view of <https://bounty.xe.network/XE-11745>. The page is the record; this is the same page for reading.*

XE-11745 · Bounty

# \[Minor\] Handler \`/metrics\` menjalankan \`preScrape\` SEBELUM batas \`MaxRequestsInFlight\`, dan gauge readiness bisa terpotret sobek

Closed · invalid
—claimed Minor
web
filed 2026-11-13 08:05 UTC
by cunels

Verdict
:   Invalid

Tier
:   —

Claimed
:   Minor

Area
:   Node / API

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 13:19 UTC

Told
:   2026-11-20 13:19 UTC

### Patches

None linked.

### History

- [600747](https://bounty.xe.network/log/600747) 2026-11-20 13:19 UTC reply.sent
- [599923](https://bounty.xe.network/log/599923) 2026-11-20 13:03 UTC proposal.adopted
- [599701](https://bounty.xe.network/log/599701) 2026-11-20 13:03 UTC proposal.adopted
- [599700](https://bounty.xe.network/log/599700) 2026-11-20 13:03 UTC ticket.status new → closed
- [599416](https://bounty.xe.network/log/599416) 2026-11-20 13:03 UTC proposal.adopted
- [599415](https://bounty.xe.network/log/599415) 2026-11-20 13:03 UTC ticket.facts area
- [599414](https://bounty.xe.network/log/599414) 2026-11-20 13:03 UTC proposal.adopted
- [599413](https://bounty.xe.network/log/599413) 2026-11-20 13:03 UTC ticket.facts
- [587273](https://bounty.xe.network/log/587273) 2026-11-20 09:37 UTC note.added
- [587272](https://bounty.xe.network/log/587272) 2026-11-20 09:37 UTC proposal.created
- [587271](https://bounty.xe.network/log/587271) 2026-11-20 09:37 UTC proposal.created
- [587270](https://bounty.xe.network/log/587270) 2026-11-20 09:37 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-11745) · [JSON](https://bounty.xe.network/v1/tickets/XE-11745) · [markdown](https://bounty.xe.network/XE-11745.md)

### Report

Judul: \[Minor\] Handler `/metrics` menjalankan `preScrape` SEBELUM batas `MaxRequestsInFlight`, dan gauge readiness bisa terpotret sobek

Letak Bug:
`xe/metrics/metrics.go:163-177` — `Handler()` memanggil `preScrape` (`publishDerived`, `node/observability.go:317-356`) sebelum `inner.ServeHTTP` yang menegakkan `MaxRequestsInFlight: 4`. Request /metrics yang langsung ditolak 503 oleh promhttp tetap membayar biaya penuh `publishDerived` (alokasi peer slice \+ kunci swarm libp2p lewat `o.peerCount()`). `o.publish` (`observability.go:283-315`), `o.publishDerived` (317-356), dan `Registry.Gather()` juga membaca-menulis 20\+ gauge readiness tanpa mutual exclusion di tingkat kelompok gauge.

Seberapa Buruk Bug nya:
Amplifikasi kerja kecil pada endpoint tanpa autentikasi (biaya per request kecil, tapi cap konkurensi menjadi tidak berguna karena request yang ditolak pun tetap menjalankan `preScrape`) \+ snapshot readiness yang bisa kontradiktif dalam satu payload scrape (`xe_ready 1` bersama `xe_ready_check 0`). Minor — tidak ada dana atau konsensus yang bergerak.

### Thread

**XE desk**team2026-11-20 13:19 UTCdesk

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links
https://bounty.xe.network/XE-11745 and says what; it is read like any other.
