Commit 22e82e8
authored
trace: tweak tracing & test support for the multithreaded runtime (#616)
This branch makes a couple minor tweaks to improve tracing with the
multithreaded Tokio runtime.
It enables the option to print thread IDs when logging trace output,
which should make it somewhat clearer when events occur on different
threads.
Additionally, there's currently an issue where traces are not logged
from the proxy during integration tests. Only traces from the test
support code are logged. This is because we are using `tracing`'s scoped
thread-local dispatcher in the test proxy, so that each test can create
its own subscriber. We set the test's subscriber as the default for the
test proxy thread, but *not* as the global default for all threads.
However, when the multithreaded runtime is enabled, the default runtime
returned by `tokio::runtime::Runtime::new` is now a multithreaded
runtime. Therefore, the test proxy runs on the runtime's worker threads,
rather than the main thread spawned by the tests, and the dispatcher is
not set for the worker threads.
This branch fixes that issue by explicitly using the basic (single
threaded) scheduler when creating the test proxy. This should
(hopefully) also improve test flakiness a bit by not spawning a whole
bunch of workers.1 parent 0603e14 commit 22e82e8
2 files changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | | - | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
314 | 317 | | |
315 | 318 | | |
316 | 319 | | |
| |||
0 commit comments