Commit 629f831
committed
roachtest: task logger creation error handling
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: None1 parent 7189668 commit 629f831
File tree
2 files changed
+36
-1
lines changed- pkg/cmd/roachtest/roachtestutil/task
2 files changed
+36
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
41 | 75 | | |
42 | 76 | | |
43 | 77 | | |
| |||
0 commit comments