Skip to content

Fix outgoing telemetry DatasetWriterName unexpected suffix - #2453

Merged
Marc Schier (marcschier) merged 5 commits into
mainfrom
copilot/fix-outgoing-telemetry-suffix
Jun 8, 2026
Merged

Marc Schier (marcschier) merged 5 commits into
mainfrom
copilot/fix-outgoing-telemetry-suffix

Conversation

Copilot AI commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

opc-publisher could append a numeric suffix to a writer's DataSetWriterName (e.g. expected1 instead of expected) on outgoing telemetry despite no duplicate writers, and a container restart would change the emitted name — both surprising and non-deterministic.

Root cause

WriterGroupDataSource.UpdateAsync tracks live writer names in a local writerNames set used by CreateUniqueWriterName for deduplication. When a reconfiguration changes a writer's equality/hash (e.g. topic, QoS, TTL, publishing interval), the writer is removed and re-added. On removal the subscription was disposed and dropped from _writers, but its name was not removed from writerNames. The re-added writer then collided with its own stale name and got a suffix.

Since writerNames is rebuilt from live writers each update, the name oscillated with the parity of hash-changing reconfigurations — explaining both the intermittent suffix and why a restart (fresh StartAsync from an empty set) reset it.

Changes

  • WriterGroupDataSource.UpdateAsync: release the writer's name from writerNames when removing it, so a re-added writer reuses the same name deterministically.
if (_writers.Remove(key, out var s))
{
    // Release the writer name so it can be reused by a
    // newly added writer below.
    writerNames.Remove(s.Name);
    await s.DisposeAsync().ConfigureAwait(false);
}
  • WriterGroupDataSourceTests: added a regression test that reconfigures a single writer in a way that forces remove+add and asserts the emitted message WriterName stays expected (fails as expected1 without the fix).

Copilot AI changed the title [WIP] Fix unexpected suffix in DatasetWriterName for telemetry Fix outgoing telemetry DatasetWriterName unexpected suffix Jun 8, 2026
@marcschier
Marc Schier (marcschier) marked this pull request as ready for review June 8, 2026 14:15
@marcschier
Marc Schier (marcschier) requested a review from a team as a code owner June 8, 2026 14:15
@marcschier
Marc Schier (marcschier) merged commit 29f6ac4 into main Jun 8, 2026
22 checks passed
@marcschier
Marc Schier (marcschier) deleted the copilot/fix-outgoing-telemetry-suffix branch June 8, 2026 15:33
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.

Outgoing telemetry DatasetWriterName has unexpected suffix

2 participants