1
0
mirror of https://github.com/prometheus/alertmanager.git synced 2026-10-24 20:39:28 +03:00
Commit Graph

2 Commits

Author SHA1 Message Date
June Kim
1193873419 httpserver: make /-/reload handler cancellation-safe
Fix three bugs in the reload handler identified in #5103:

1. Use a buffered error channel (size 1) so the reloader goroutine
   never blocks if the HTTP client disconnects before reading the
   result.

2. Remove the incorrect `defer close(errc)` — the handler is the
   receiver, not the sender; closing from the receiver side could
   panic the sender.

3. Wrap both the enqueue (send to reloadCh) and the reply (receive
   from errc) in select statements that also listen on
   req.Context().Done(), so a client disconnect unblocks the handler
   at either stage.

Fixes #5103

Signed-off-by: June Kim <kimjune01@gmail.com>
Signed-off-by: Solomon Jacobs <solomonjacobs@protonmail.com>
2026-08-19 11:59:49 +02:00
Solomon Jacobs
b6490116c7 ui: Move useful parts to httpserver (#5097)
In the future, we want to remove the ui build artifacts from the
repository. This will break the usages of

```sh
go get github.com/prometheus/alertmanager/ui
```

That is exactly as expected, since the ui can't function correctly
without the ui artefacts.

This change attempts to make the transition a bit less painful.

Signed-off-by: Solomon Jacobs <solomonjacobs@protonmail.com>
2026-03-26 20:24:39 +01:00