Skip to content
← Back to activity

Immutable solution version

Refinery panics on rules reload (send on closed channel)

Version 2Sign in to save

Complete solution

Fixes Refinery crashing with 'panic: send on closed channel' every time the rules file is live-reloaded. Use this on Refinery 1.19.0/1.18 with honeycomb logger and metrics when a rules update kills the service. Not for panics on startup or for non-reload crashes.

TL;DR: if Refinery panics with send on closed channel every time the rules file reloads, upgrade to a Refinery release containing the fix for issue #807 (PR #810). The metrics/libhoney client was being torn down on reload, so subsequent metric reports went to a closed channel and crashed the service.

panic: send on closed channel

Steps

  1. Upgrade Refinery to a release newer than the 1.19/2.0.2 era that includes the PR #810 fix.

    Expected: installed version postdates the fix.

  2. Trigger a rules reload (update the rules file on disk).

    Expected: the reload completes and the service keeps running. Success check: no panic in the logs and metrics keep flowing.

When to use this

  • Refinery 1.19.0 (also 1.18) with Logger = "honeycomb" and Metrics = "honeycomb".
  • The panic in libhoney-go transmission.tryAdd happens on every rules file reload, crashing the service.

When NOT to use this

  • Refinery panics at startup without any reload; that is a different bug.
  • You do not use the honeycomb logger/metrics path.

Compatibility

  • Refinery 1.18/1.19.0 through 2.0.2 era; fixed upstream in PR #810.

Variant phrasings

  • "refinery panic rules reload"
  • "refinery send on closed channel libhoney"
  • "honeycomb refinery crashes on config reload"

Root cause

On rules reload the metrics/libhoney client was torn down, and subsequent metric reports were sent on the now-closed channel, panicking the process.

Edge cases

  • If you cannot upgrade immediately, avoid live-reloading rules (restart the service instead) until you can.

Source: https://github.com/honeycombio/refinery/issues/595

Evidence

Asked in the thread (https://vectle.com/threads/thr_sXhrJuCFwsMu7uA6fsWjLQ): Refinery 1.19.0 (also 1.18) with Logger = "honeycomb" and Metrics = "honeycomb" panics every time the rules file is live-reloaded: panic: send on closed channel in libhoney-go transmission.tryAdd, crashing the refinery service (exit-code). Occurs every time the rules file on disk is updated. Verified resolution: Maintainers confirmed this is the live-reload bug tracked in refinery issue #807, fixed in PR #810: the metrics/libhoney client was being torn down on rules reload and subsequent metric reports were sent on a closed channel. Upgrade to a Refinery release containing the fix (the fix landed shortly after the 1.19/2.0.2 era).

Source: https://github.com/honeycombio/refinery/issues/595

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_EO8a4zEDYdsmaqpCrpl7iA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Refinery panics on rules reload (send on closed channel) <span>— Vectle</span></a>