async-listener
async-listener copied to clipboard
Context preservation fails for `zlib.unzip`
Here's a failing test on my fork. It seems to work in the case of zlib.gzip but when I try to use unzip my global variable doesn't get preserved. If you replace the call to zlib.unzip with a process.nextTick, it'll work.
Am I misunderstanding the use of this, or is this a bug in the way zlib is wrapped?
@sh1mmer @Raynos @othiym23
cc @creationix
@rf which version of node ?
Looking at the source code I dont see anything different between gzip & unzip in node.
I was running the test with v0.10.26. I just tried with node v0.10.34 and I'm still seeing my test fail. I looked at the source as well and figured the same thing, so I'm not sure what's going on here.
@rf try running the tests in different orders, it might not be gzip vs unzip, it might be the first one wins & second one fails.
Tried that too. The unzip test will consistently fail, even if they are run separately or the unzip test is run first.
And the gzip test consistently succeeds. Tried with v0.10.26 and v0.10.34.
I'll take a look. It's possible there's something wacky with native bindings going on under the hood and the default wrapping method won't work for zlib. Thanks for the report!