4 Commits
Author SHA1 Message Date
Matthew HoltandCopilot 48bf07591a caddy: run OnCancel callbacks and restore std logger on reload
Callbacks registered with OnCancel were appended to a copy of the
Context and never ran on config unload, so e.g. the std log redirect to
a removed sink was never undone. Share callbacks across copies of a
Context so they run exactly once on cancellation; callbacks registered
after cancellation run immediately, and OnCancel on a zero-value
Context remains safe.

Since overlapping configs mean an old config's cleanup runs after the
new one is set up, track ownership of the default logger and std log
redirect so cleanup restores the most recent live config's state.

Addresses scan report 88637e95bf243f5a.

Code written by GitHub Copilot (GPT-6.1 Sol, Claude Opus 5.5); reviewed by mholt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-11 11:06:40 -07:00
Kévin DunglasandCopilot Autofix powered by AI 4e62095245 core: preserve metrics registry in Context.WithValue (#7861)
* core: preserve metrics registry in Context.WithValue

Context.WithValue rebuilt the Context without copying the unexported
metricsRegistry field, so any module provisioned under a context
derived via WithValue saw a nil registry from GetMetricsRegistry().

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Kévin Dunglas <kevin@dunglas.fr>

---------

Signed-off-by: Kévin Dunglas <kevin@dunglas.fr>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-08 04:52:36 +10:00
Francis Lavoie 141872ed80 chore: Bump up to Go 1.19, minimum 1.18 (#4925) 2022-08-02 16:39:09 -04:00
Matthew Holt fab5e4372a core: Add godoc examples for LoadModule 2019-12-10 14:06:35 -07:00