Skip to content

fix: do not mask dial errors with KeyError - #567

Merged
enocom merged 1 commit into
mainfrom
telemetry-2-remove-cached-keyerror
Sep 21, 2026
Merged

enocom merged 1 commit into
mainfrom
telemetry-2-remove-cached-keyerror

Conversation

@enocom

@enocom enocom commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

_remove_cached popped the instance's cache without a default, so a failed
dial against static connection info raised KeyError over the top of the
error that sent it there. The static connection info path builds its
cache per connect and never stores it in self._cache, so the pop always
misses.

Tolerate the miss in both connectors. Only the synchronous Connector
supports static connection info and can hit this today; AsyncConnector
gets the same guard so the two cannot drift.

Related to #449

@enocom

enocom commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

Here's where we are in this PR Chain:

  1. refactor: extract _metadata_exchange helper #566 — refactor: extract _metadata_exchange helper
  2. fix: do not mask dial errors with KeyError #567 — fix: do not mask dial errors with KeyError ← you are here
  3. fix: close the socket when the metadata exchange fails #568 — feat: classify connection failures
  4. chore: add telemetry provider, recorders, and exporter #569 — chore: add telemetry provider, recorders, and exporter
  5. chore: add InstrumentedSocket #570 — chore: add InstrumentedSocket
  6. chore: record refresh metrics #571 — chore: record refresh metrics
  7. chore: wire telemetry into Connector, off by default #572 — chore: wire telemetry into Connector, off by default
  8. chore: wire telemetry into AsyncConnector, off by default #573 — chore: wire telemetry into AsyncConnector, off by default
  9. feat: enable built-in telemetry by default #574 — feat: enable built-in telemetry by default

Group A (1–3) is independent of telemetry and could ship on its own; #568 carries the only user-visible breaking change. Group B (4–8) is inert because enable_builtin_telemetry defaults to False throughout. #574 flips that default, so reverting it alone turns the whole feature off.

_remove_cached popped the instance's cache without a default, so a failed
dial against static connection info raised KeyError over the top of the
error that sent it there. The static connection info path builds its
cache per connect and never stores it in self._cache, so the pop always
misses.

Tolerate the miss in both connectors. Only the synchronous Connector
supports static connection info and can hit this today; AsyncConnector
gets the same guard so the two cannot drift.
@enocom
enocom force-pushed the telemetry-2-remove-cached-keyerror branch from f4c2d75 to 3b807a4 Compare September 19, 2026 03:26
@enocom
enocom marked this pull request as ready for review September 19, 2026 03:27
@enocom
enocom requested a review from a team as a code owner September 19, 2026 03:27
@enocom
enocom added this pull request to stack #577 September 19, 2026 04:15
@enocom
enocom merged commit 6b0f51f into main Sep 21, 2026
27 checks passed
@enocom
enocom deleted the telemetry-2-remove-cached-keyerror branch September 21, 2026 19:44
@enocom
enocom restored the telemetry-2-remove-cached-keyerror branch September 24, 2026 04:44
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.

2 participants