Skip to content

Commit 5fd6690

Browse files
authored
Constrain async ID collection to main thread only (#5559)
1 parent a64340b commit 5fd6690

File tree

1 file changed

+3
-1
lines changed
  • packages/dd-trace/src/profiling/profilers

1 file changed

+3
-1
lines changed

packages/dd-trace/src/profiling/profilers/wall.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ function ensureChannelsActivated () {
7070
class NativeWallProfiler {
7171
constructor (options = {}) {
7272
this.type = 'wall'
73-
this._asyncIdEnabled = !!options.asyncIdEnabled
73+
// Currently there's a crash sometimes on worker threads trying to collect async IDs so for the
74+
// time being we'll constrain it to only the main thread.
75+
this._asyncIdEnabled = !!options.asyncIdEnabled && require('worker_threads').isMainThread
7476
this._codeHotspotsEnabled = !!options.codeHotspotsEnabled
7577
this._cpuProfilingEnabled = !!options.cpuProfilingEnabled
7678
this._endpointCollectionEnabled = !!options.endpointCollectionEnabled

0 commit comments

Comments
 (0)