fs.exists with util.promisify causes to unhandled rejection #1185
Labels
bug
Something isn't working
pkg:instrumentation-fs
priority:p1
Bugs which cause problems in end-user applications such as crashes, data inconsistencies
What version of OpenTelemetry are you using?
Latest installed globally.
Installed dependencies:
npm i --unsafe-perm -g @splunk/otel @opentelemetry/api @opentelemetry/instrumentation-http @opentelemetry/instrumentation-express @opentelemetry/instrumentation-pino @opentelemetry/instrumentation-winston @opentelemetry/instrumentation-nestjs-core @opentelemetry/instrumentation-ioredis @opentelemetry/instrumentation-fs opentelemetry-instrumentation-mongoose @opentelemetry/instrumentation-dns @opentelemetry/instrumentation-amqplib
Note: Also tried to install everything except fs but same behaviour.
What version of Node are you using?
v16.17.0
What did you do?
Reproducing is easy:
test.mjs
What did you expect to see?
fs.exists should return 'true' as a resolved value and not as a rejected value.
What did you see instead?
Executing node with
node -r @splunk/otel/instrument test.mjs
causes to this error:node:internal/process/esm_loader:97
internalBinding('errors').triggerUncaughtException(
^
true
(Use
node --trace-uncaught ...
to show where the exception was thrown)Without -r @splunk/otel/instrument it works as expected.
Additional context
It looks like the promisified fs.exists is handled incorrectly (CB parameters) by opentelemetry and Promise.reject is called with (true) instead of resolve.
The text was updated successfully, but these errors were encountered: