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
% node index
Fails to start:
/home/lapo/test/node_modules/restify/lib/dtrace.js:68
PROVIDER.enable();
^
Error: failed to load DOF: No such file or directory
at exportStaticProvider (/home/lapo/test/node_modules/restify/lib/dtrace.js:68:18)
at Object.<anonymous> (/home/lapo/test/node_modules/restify/lib/dtrace.js:80:3)
at Module._compile (internal/modules/cjs/loader.js:702:30)
Repro case
I minimized the test case from restify's dtrace.js file:
DTrace instantiation is protected by try/catch but when DTrace is not available in the kernel (as the module is not loaded) it actually fails on PROVIDER.enable(), which is outside of the try.
Are you willing and able to fix this?
Yes, I could do a PR that extends the try to the whole section.
This is connected to chrisa/node-dtrace-provider#117 but we can probably avoid it on our side that way.
The text was updated successfully, but these errors were encountered:
Thank you for the awesome detective work on this @lapo-luchini!
If this can throw I’m in favor of catching as long as we can do it in a way that doesn’t leave the dtrace module in a half-instatiated state. The code should gracefully fallback to dropping dtrace support in the same way that it does if the install isn’t there.
CC’ing @yunong since I think he has a much better understanding of the dtrace provider than I do.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Bug Report
Restify Version
7.2.1
Node.js Version
10.3.0
Expected behaviour
Start correctly.
Actual behaviour
Repro case
I minimized the test case from
restify
'sdtrace.js
file:Cause
DTrace instantiation is protected by
try/catch
but when DTrace is not available in the kernel (as the module is not loaded) it actually fails onPROVIDER.enable()
, which is outside of thetry
.Are you willing and able to fix this?
Yes, I could do a PR that extends the
try
to the whole section.This is connected to chrisa/node-dtrace-provider#117 but we can probably avoid it on our side that way.
The text was updated successfully, but these errors were encountered: