-
Notifications
You must be signed in to change notification settings - Fork 149
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
HandleScope::HandleScope Entering the V8 API without proper locking in place #118
Comments
Similar problem demonstrated by the following test case in tap.test('eval pool with callback that throws', function(t) {
var tcount = 0;
function test() {
console.log('test function in thread pool');
}
var mypool = Threads.createPool(5);
//mypool.all.eval(test);
mypool.all.eval('test()', function(err, data) {
++tcount;
if (tcount === 2)
throw new Error('boom');
if (tcount == 5) {
mypool.destroy();
t.end();
}
});
}); |
The following change (with JavaScript code regenerated by diff --git a/src/createPool.ls b/src/createPool.ls
index f12894b..f464560 100644
--- a/src/createPool.ls
+++ b/src/createPool.ls
@@ -41,7 +41,10 @@ function create-pool (n)
next-job t
f = job.cb-or-data
if typeof f is \function
- f.call t, e, d
+ try
+ f.call t, e, d
+ catch e
+ return e
else
t.emit job.src-text-or-event-type, f
else if job.type is 2 # EMIT Going to sleep now, hope to give it a try when I am up again. |
Any progress on this? Running into the exact same error. |
Fixed in webworker-threads-0.7.10. Thanks for the reminder! |
Thank you, will test later. |
Hi,
Working with the following code:
I can consistently reproduce the following error:
Node: 4.5.0, 6.3.1, 6.5.0
OS: OSX 10.11.6
EDIT 1:
The issue was caused due to an error in the callback,
err
isnull
(silly me), so it would throw when accessingerr.stack
I think this is still an issue because the error in the callback did not bubble up and did not appear, even with
process.on('uncaughtException', (err)=>console.error(err))
present.The text was updated successfully, but these errors were encountered: