Fix null-key tag in OpenTelemetry receive fallback#1205
Conversation
The non-NatsConnection receive path allocated a fixed 10-slot tag array but
only filled the reply-to slot when a reply-to was present, leaving a default
{null, null} entry that was handed to StartActivity. Size the array to the
tags actually set, matching the send path.
|
Claude finished @mtmk's task in 1m 44s —— View job PR Review
SummaryThe fix is correct and minimal. The fallback branch in No issues found. A couple of minor observations for awareness: Observation 1 — In the fallback branch ( tags[3] = new KeyValuePair<string, object?>(Constants.QueueGroup, queueGroup); // value may be nullThe primary path (lines 281–282) conditionally adds it only when non-null. This asymmetry is pre-existing and unrelated to this PR — it doesn't cause a null-key issue — but it means the fallback always emits a Observation 2 — Test covers the regression well The test correctly targets the fallback branch by using an unstarted
Both |
The receive-path telemetry fallback (used when the connection is not a fully connected NatsConnection) allocated a fixed-size tag array but only populated the reply-to slot conditionally, leaving a default null-keyed entry that was passed to StartActivity when there was no reply-to. Size the array to the tags actually set, matching the send path, and add a regression test over the fallback branch.