Comments (4)
I'm running Node LTS (v4) in production
I can't recommend running trace
in production. trace
causes serious performance penalties, because it needs to capture the stack trace for every async operation you perform.
I notice that since v1.3.0, async-hook now only supports Node v5. Seeing as this was only a minor semver bump to the async-hook module (despite being a breaking change), that means that trace will depend on the new version, and therefore implicitly requires node v5.
You are correct. However async-hook
uses async_wrap
from node.js which is an undocumented API that we are working on. Thus there will be API changes in patch-updates in node.js. This makes it practically impossible to conform with semver standards.
Thus async-hook
uses the following approximation:
- patch: non breaking fix
- minor: update to a new async_wrap API from node.js
- major: API addition or API breaking on the async-hooks end
Is there a way we can get trace working on v4 as well as v5? Thanks!
The above rules means that you can use async-hook
and maintain backward compatibility by installing the latest major stable version ^1.0.0
that supports your current node version (in your case 1.2.0
).
Unfortunately npm doesn't check your node version and there is no flag to enable that. Thus the best you can do is to remove the async-hook
module manually and install 1.2.0
.
I imagine I'm not the only one running the LTS version of node
No you are not. I have been thinking about removing async-hook
from the dependencies list and add an install script, that will download the correct async-hook
version automatically. But I'm too busy for that right now. PRs are appreciated.
Eventually the async_wrap
changes will be backported to node v4 and the latest version of async-hook
will then work. You can ask about the progress here: nodejs/Release#86
from trace.
Hey there – thanks for the thoughtful response, sorry for the delay in replying (and the accidental commit-spam!)
Completely understand all your points, it sounds a nightmare trying to keep in sync with a private API. For me, the additional error information is definitely worth the performance hit, but if it's not for production use then I guess you could put a warning on the readme? (also that it requires node v5?) Up to you of course.
I didn't realize you also made async-hook
, impressive work! I'll submit a PR for that package, which reinstates the prior behavior on Node v4 – let me know on that thread if this is a step in the wrong direction.
Thanks!
from trace.
For me, the additional error information is definitely worth the performance hit, but if it's not for production use then I guess you could put a warning on the readme?
Yeah, I had such a warning a long time ago, I should properly get that back.
from trace.
Node.js v4.5.0 is now available. This has the latest AsyncWrap API and thus trace
should work out of the box.
from trace.
Related Issues (20)
- TypeError: Cannot read property 'apply' of undefined HOT 4
- does it work in frontend when used with webpack/browserify HOT 1
- Source map support HOT 2
- I get this error when running node 4.4.5 HOT 2
- current uid is a stack HOT 1
- Compatibility with node ^7.0 HOT 2
- The dreaded "throwing after await" HOT 19
- Memory leak of sorts HOT 5
- Stack Trace makes no sense HOT 3
- Usage with electron HOT 1
- Conflict of stack-trace version with the one from clarify HOT 1
- Add GitHub releases HOT 2
- Add an `install` method HOT 1
- Treating error.stack as immutable? HOT 2
- Memory leak HOT 4
- `executionScopeDepth` does not make sense if concurrent async operations HOT 1
- Error: Conflicting version of stack-chain found HOT 4
- Control stack trace reset
- Error security context
- Swallowing errors with Axios HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trace.