Skip to content

Conversation

@tigrannajaryan
Copy link
Member

Fixes #42947

TestHarness_MetricsGoldenData/stef-stef was sporadically failing because of a bug in the implementation of Create() function. Just created connection could have been closed because of the bug, depending on the order of "select" operations and the timing of other operations.

This now fixes the bug, ensuring the code does not try to cancel a successfully created connection.

I managed to create a simple repro by adding a time delay in the inner goroutine, but I won't be commiting the change since it is detrimental to production code. There is no trivial way to add a reliable test that verifies specifically this bug, but TestHarness_MetricsGoldenData/stef-stef was already hitting it once in a while, so we will rely on that as the test that verifies the bug fix.

@dmitryax
Copy link
Member

dmitryax commented Nov 4, 2025

@tigrannajaryan please add a changelog entry in .chloggen

Fixes open-telemetry#42947

TestHarness_MetricsGoldenData/stef-stef was sporadically failing because
of a bug in the implementation of Create() function. Just created connection
could have been closed because of the bug, depending on the order of "select"
operations and the timing of other operations.

This now fixes the bug, ensuring the code does not try to cancel a successfully
created connection.

I managed to create a simple repro by adding a time delay in the inner goroutine,
but I won't be commiting the change since it is detrimental to production code.
There is no trivial way to add a reliable test that verifies specifically this
bug, but TestHarness_MetricsGoldenData/stef-stef was already hitting it once in
a while, so we will rely on that as the test that verifies the bug fix.
@tigrannajaryan tigrannajaryan force-pushed the tigran/fix-stef-metric-golden branch from 5dbe5c0 to ef3aabd Compare November 5, 2025 18:55
@tigrannajaryan
Copy link
Member Author

@tigrannajaryan please add a changelog entry in .chloggen

Added.

@songy23 songy23 merged commit ad036ab into open-telemetry:main Nov 5, 2025
189 checks passed
@github-actions github-actions bot added this to the next release milestone Nov 5, 2025
@tigrannajaryan tigrannajaryan deleted the tigran/fix-stef-metric-golden branch November 5, 2025 20:18
jelly-afk pushed a commit to jelly-afk/opentelemetry-collector-contrib that referenced this pull request Nov 6, 2025
…en-telemetry#44048)

Fixes
open-telemetry#42947

TestHarness_MetricsGoldenData/stef-stef was sporadically failing because
of a bug in the implementation of Create() function. Just created
connection could have been closed because of the bug, depending on the
order of "select" operations and the timing of other operations.

This now fixes the bug, ensuring the code does not try to cancel a
successfully created connection.

I managed to create a simple repro by adding a time delay in the inner
goroutine, but I won't be commiting the change since it is detrimental
to production code. There is no trivial way to add a reliable test that
verifies specifically this bug, but
TestHarness_MetricsGoldenData/stef-stef was already hitting it once in a
while, so we will rely on that as the test that verifies the bug fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[testbed/correctnesstests/metrics]: Report for failed tests on main

4 participants