Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TO DELETE][DO NOT MERGE] Force crash #5079

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/dd-trace/src/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
}

init (options) {
throw new Error('Crash')
if (this._initialized) return this

Check failure on line 57 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code

this._initialized = true

Expand All @@ -74,12 +75,12 @@
this.dogstatsd.flush()
}, 10 * 1000).unref()

process.once('beforeExit', () => {

Check failure on line 78 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code
this.dogstatsd.flush()
})
}

if (config.spanLeakDebug > 0) {

Check failure on line 83 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code
if (config.spanLeakDebug === spanleak.MODES.LOG) {
spanleak.enableLogging()
} else if (config.spanLeakDebug === spanleak.MODES.GC_AND_LOG) {
Expand All @@ -100,7 +101,7 @@
this._enableOrDisableTracing(config)
})

rc.setProductHandler('AGENT_CONFIG', (action, conf) => {

Check failure on line 104 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code
if (!conf?.name?.startsWith('flare-log-level.')) return

if (action === 'unapply') {
Expand All @@ -111,7 +112,7 @@
}
})

rc.setProductHandler('AGENT_TASK', (action, conf) => {

Check failure on line 115 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code
if (action === 'unapply' || !conf) return
if (conf.task_type !== 'tracer_flare' || !conf.args) return

Expand All @@ -119,12 +120,12 @@
this._flare.module.send(conf.args)
})

if (config.dynamicInstrumentation.enabled) {

Check failure on line 123 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code
DynamicInstrumentation.start(config, rc)
}
}

if (config.isGCPFunction || config.isAzureFunction) {

Check failure on line 128 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code
require('./serverless').maybeStartServerlessMiniAgent(config)
}

Expand All @@ -151,12 +152,12 @@
})
}

if (!this._profilerStarted) {

Check failure on line 155 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code
this._profilerStarted = Promise.resolve(false)
}
}

if (config.runtimeMetrics) {

Check failure on line 160 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code
runtimeMetrics.start(config)
}

Expand Down Expand Up @@ -186,7 +187,7 @@
const testVisibilityDynamicInstrumentation = require('./ci-visibility/dynamic-instrumentation')
testVisibilityDynamicInstrumentation.start(config)
}
} catch (e) {

Check failure on line 190 in packages/dd-trace/src/proxy.js

View workflow job for this annotation

GitHub Actions / lint

Unreachable code
log.error('Error initialising tracer', e)
}

Expand Down
Loading