Skip to content

Conversation

@herkolategan
Copy link
Collaborator

Previously, if a task failed to create a logger internally during the call to create a goroutine, the error would only be returned if the task (or task group) was waited on with WaitE. This could lead to a race condition in tests, since it's expected that the function passed to the task.Go call is executed. And if something within the test is waiting on results from that goroutine, it could end up waiting indefinitely.

This change ensures the function passed to a task.Go call is always executed. The only way this could not happen currently was if an error occurred while trying to create a logger for the task. This has been updated to rather fall back to the root logger; and print an error to the root logger.

Informs: #156635
Epic: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@herkolategan herkolategan marked this pull request as ready for review November 5, 2025 18:10
@herkolategan herkolategan requested a review from a team as a code owner November 5, 2025 18:10
@herkolategan herkolategan requested review from DarrylWong, golgeek and srosenberg and removed request for a team November 5, 2025 18:10
Previously, if a task failed to create a logger internally during the call to
create a goroutine, the error would only be returned if the task (or task group)
was waited on with `WaitE`. This could lead to a race condition in tests, since
it's expected that the function passed to the `task.Go` call is executed. And if
something within the test is waiting on results from that goroutine, it could
end up waiting indefinitely.

This change ensures the function passed to a `task.Go` call is always executed.
The only way this could not happen currently was if an error occurred while
trying to create a logger for the task. This has been updated to rather fall
back to the root logger; and print an error to the root logger.

Informs: cockroachdb#156635
Epic: None
@herkolategan herkolategan force-pushed the hbl/roachtest-task-logger-fallback branch from 031a1f0 to 629f831 Compare November 6, 2025 09:03
@herkolategan
Copy link
Collaborator Author

TFTRs!

bors r=DarrylWong,srosenberg

@craig
Copy link
Contributor

craig bot commented Nov 6, 2025

@craig craig bot merged commit 944a705 into cockroachdb:master Nov 6, 2025
33 of 34 checks passed
@herkolategan herkolategan requested a review from dt November 6, 2025 12:54
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.

4 participants