You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep JS tracing decisions tied to the env-local tracing state
materialized by the native toggle path instead of rereading live flags
in multiple places.
Tracing flags can be updated from any thread, so reading them directly
during span creation can observe a mid-flight toggle. That could make
Tracer.startSpan() return a NonRecordingSpan after the caller had
already passed an internal tracing gate, leading to crashes like
TypeError: span._pushSpanDataString is not a function.
Pass the full tracing bitmask from EnvList::update_tracing_flags() into
JS, cache it in lib/internal/nsolid_trace.js, and make the internal
OTel code consume that cached per-thread state. This removes the
split-brain behavior where callback binding/unbinding followed
flagsUpdated but Tracer.startSpan() could independently observe a later
disable and return a NonRecordingSpan.
For internal spans, stop Tracer.startSpan() from rechecking the current
trace flags after the caller has already crossed an internal tracing
gate. That keeps internal span creation locally consistent while
tracing is being enabled and disabled and avoids crashes in code paths
that expect a real N|Solid span object.
Also add targeted repro coverage for the toggle race:
- extend the tracing test addon with configurable setupTracing(flags),
stopTracing(), and skipExpectedTracesCheck()
- add a deterministic fetch-based repro that toggles HTTP client
tracing while concurrent fetch() traffic is in flight
- add a grpc-based repro harness for tracing reconfiguration and cover
both fetch and http traffic
- teach the grpc agent test client how to generate fetch transactions
Together these changes make trace flags materialize per env/thread in
JS, preserve the caller's local tracing decision for internal spans,
and add regression coverage for the tracing enable/disable race.
0 commit comments