Skip to content

Commit 2476614

Browse files
committed
trace2: add default thread name value of "main"
The TRACE2 convention for thread naming is for each child process's main thread of execution to be named "main." In GCM, however, we encountered an issue with our UI Helper exes - their main threads of execution are named AppMain. To temporarily work around this issue, we default the thread name for all TRACE2 events to "main" (rather than changing GCM's process names). This will do for our current events, which are all called from the main thread of execution. However, it is important to note that future events (i.e. regions) will require deeper thought around the GCM/TRACE2 process model, as they will be called on threads from .NET's ThreadPool rather than the main thread of execution.
1 parent 6b2459c commit 2476614

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shared/Core/Trace2.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,9 @@ public abstract class Trace2Message
309309
[JsonProperty("sid", Order = 2)]
310310
public string Sid { get; set; }
311311

312+
// TODO: Remove this default value when TRACE2 regions are introduced.
312313
[JsonProperty("thread", Order = 3)]
313-
public string Thread { get; set; }
314+
public string Thread { get; set; } = "main";
314315

315316
[JsonProperty("time", Order = 4)]
316317
public DateTimeOffset Time { get; set; }

0 commit comments

Comments
 (0)