Skip to content

fix: Handle ignored errors across the codebase - #39

Merged
bpalermo merged 2 commits into
mainfrom
fix/error-handling
Mar 22, 2026
Merged

bpalermo merged 2 commits into
mainfrom
fix/error-handling

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Summary

  • Fix 13 instances of ignored errors (_ = err) across 7 files
  • Cleanup/defer paths now log errors at appropriate levels
  • Removed 2 dead MarkPersistentFlagRequired calls for never-registered flags (proxy-region, proxy-zone)
  • Fixed MarkPersistentFlagRequired → MarkFlagRequired for local flags
  • Added must() helper for flag registration errors (programming errors that should panic)

Files Changed

  • xds/server.go — Log listener close error on chmod failure
  • common/file/file.go — Log temp file cleanup errors at debug level
  • registry/internal/etcd/etcd.go — Log client close error
  • agent/internal/spire/bridge.go — Log client close error
  • cni/internal/cri/cri.go — Document intentional ignore with comment
  • cni/internal/util/watcher.go — Log watcher close error
  • agent/pkg/cmd/root.go — Fix flag required calls, remove dead code

Test plan

  • bazel test --config=llm //... passes (17/17 non-integration tests)

🤖 Generated with Claude Code

Replace `_ = err` patterns with proper error handling:

- xds/server.go: Log listener close error during chmod cleanup
- common/file/file.go: Log temp file remove/close errors during cleanup
- registry/internal/etcd/etcd.go: Log etcd client close error during cleanup
- agent/internal/spire/bridge.go: Log SPIRE client close error in defer
- cni/internal/cri/cri.go: Handle gRPC connection close error with comment
- cni/internal/util/watcher.go: Log fsnotify watcher close error
- agent/pkg/cmd/root.go: Use must() for MarkFlagRequired (panics on
  programming errors); remove dead MarkPersistentFlagRequired calls for
  non-existent proxy-region/proxy-zone flags

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@bpalermo
bpalermo force-pushed the fix/error-handling branch from 3b80db6 to d2b144f Compare March 22, 2026 13:47
Extract the must() panic-on-error helper from agent/pkg/cmd into a
reusable common/must package with a NoError function, following the
stdlib template.Must pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@bpalermo
bpalermo merged commit 95ad729 into main Mar 22, 2026
7 checks passed
@bpalermo
bpalermo deleted the fix/error-handling branch March 22, 2026 13:51
bpalermo added a commit that referenced this pull request Sep 5, 2026
… IDs, bzlmod Envoy and the symbol-cache eviction rule

Since this document was written, one of the things it asserts stopped being
true and a new failure mode appeared.

Build IDs are content-derived now (#651, #653). //tools/buildid rewrites every
Go ELF's .note.gnu.build-id to sha1 of its own bytes, and the custom Envoy gets
lld's --build-id=sha1 over the linked output, so a binary a release leaves
byte-identical keeps its ID and its already-uploaded symbols. "Every release
mints new build IDs" was literally true against rules_go's -buildid=redacted
constant; it no longer is. The sync CronJob's SKIP lines are the healthy
outcome, and the doc now shows one.

That matters because of the new trap: an upload silently evicts OTHER binaries'
converted symbols from Pyroscope's lidia cache, with nothing logged and
debuginfo list still reporting every ID as STATE_UPLOADED. On 2026-09-05 that
put Envoy's frames in hex at a soak's T0. So hex frames on an ID the sync calls
"still uploaded" mean an eviction, not a missed upload -- query the series and
re-check before touching anything -- and the warm-up after any upload has to
cover every series, including {service_name="aether-proxy",
process_executable_name="envoy"}. The proxy pod's processes separate by
process_executable_name, not k8s_container_name; a selector on the container
name matches nothing.

The path table gains the two readiness probers, which are separate ELFs with
their own build IDs riding as tars_layer entries: proxy-ready in the agent image
(#673, targets.tsv row added 2026-09-05 in GitOps #39) and mesh-dns-ready in the
mesh-dns image (#683, #688, row pending). It also records which BUILD file is
authoritative per path rather than generalising over "Go binaries".

Also documents the three build-time gates that make an unsymbolisable binary
impossible (release_build_ids, build_id_test, symtab_test #656), and notes the
proxy's move to bzlmod on an Envoy main dev snapshot (#697, #705), which
relinked the binary and moved its build ID at rev197 (6342923f -> 80542d6b).

Every command was re-verified against the live cluster: the crane extraction
paths match the running sync job's own extract lines, containers[0] is the right
container for both DaemonSets, and readelf's -B1 form is what shows the 20-byte
descriptor width that proves the sha1 linkopt won.

Docs only: no chart, template or values change, so no chart version bump.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo added a commit that referenced this pull request Sep 5, 2026
#663)

* docs(observability): explain why profile symbols decay after a release

Continuous profiling resolves native frames by GNU build ID, so a release that
mints new build IDs leaves Pyroscope unable to symbolise anything until a
matching debuginfo blob is uploaded. That failure is entirely silent -- profiles
still arrive, totals stay correct, nothing logs an error, and the flame graph
just renders hex addresses. It is normally discovered mid-investigation.

Documents how to diagnose it, the arm64 --platform trap (the same image yields a
completely different build ID per architecture, so the wrong one compares against
nothing), and where the automation lives -- an hourly CronJob in the GitOps repo
at clusters/talos-main/pyroscope-debuginfo/.

The one piece of this that is aether's knowledge rather than the cluster's is the
table of where each binary sits inside each image, so the runbook now warns that
moving a binary breaks symbolisation with nothing in CI to catch it.

Docs only: no chart, template or values change, so no chart version bump.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

* docs(observability): refresh profiling-symbols for content-hash build IDs, bzlmod Envoy and the symbol-cache eviction rule

Since this document was written, one of the things it asserts stopped being
true and a new failure mode appeared.

Build IDs are content-derived now (#651, #653). //tools/buildid rewrites every
Go ELF's .note.gnu.build-id to sha1 of its own bytes, and the custom Envoy gets
lld's --build-id=sha1 over the linked output, so a binary a release leaves
byte-identical keeps its ID and its already-uploaded symbols. "Every release
mints new build IDs" was literally true against rules_go's -buildid=redacted
constant; it no longer is. The sync CronJob's SKIP lines are the healthy
outcome, and the doc now shows one.

That matters because of the new trap: an upload silently evicts OTHER binaries'
converted symbols from Pyroscope's lidia cache, with nothing logged and
debuginfo list still reporting every ID as STATE_UPLOADED. On 2026-09-05 that
put Envoy's frames in hex at a soak's T0. So hex frames on an ID the sync calls
"still uploaded" mean an eviction, not a missed upload -- query the series and
re-check before touching anything -- and the warm-up after any upload has to
cover every series, including {service_name="aether-proxy",
process_executable_name="envoy"}. The proxy pod's processes separate by
process_executable_name, not k8s_container_name; a selector on the container
name matches nothing.

The path table gains the two readiness probers, which are separate ELFs with
their own build IDs riding as tars_layer entries: proxy-ready in the agent image
(#673, targets.tsv row added 2026-09-05 in GitOps #39) and mesh-dns-ready in the
mesh-dns image (#683, #688, row pending). It also records which BUILD file is
authoritative per path rather than generalising over "Go binaries".

Also documents the three build-time gates that make an unsymbolisable binary
impossible (release_build_ids, build_id_test, symtab_test #656), and notes the
proxy's move to bzlmod on an Envoy main dev snapshot (#697, #705), which
relinked the binary and moved its build ID at rev197 (6342923f -> 80542d6b).

Every command was re-verified against the live cluster: the crane extraction
paths match the running sync job's own extract lines, containers[0] is the right
container for both DaemonSets, and readelf's -B1 form is what shows the 20-byte
descriptor width that proves the sha1 linkopt won.

Docs only: no chart, template or values change, so no chart version bump.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant