Skip to content

async-wrap: nextTick and setImmediate is ignored #666

Description

@AndreasMadsen

Here is a test case you can run with node 0.11.14 and iojs 1.0.x.

varfs=require('fs');functionwriteSync(text){fs.writeSync(1,text+'\n');fs.fsyncSync(1);}Error.stackTraceLimit=Infinity;// Enable asyncWrap and call init hook function on async initializationtry{vartracing=require('tracing');// Setup an async listener with the handlers listed belowtracing.addAsyncListener({'create': asyncFunctionInitialized,'before': asyncCallbackBefore,'error': asyncCallbackError,'after': asyncCallbackAfter});}catch(e){varasyncWrap=process.binding('async_wrap');varasyncHooksObject={};varkCallInitHook=0;asyncWrap.setupHooks(asyncHooksObject,asyncFunctionInitialized,asyncCallbackBefore,asyncCallbackAfter);asyncHooksObject[kCallInitHook]=1;}functionasyncFunctionInitialized(){writeSync((newError()).stack);}functionasyncCallbackBefore(){}functionasyncCallbackError(){}functionasyncCallbackAfter(){}// TEST(functionouter(){setImmediate(function(){writeSync('END');});})();

In the node 0.11.14 asyncFunctionInitialized is called and the stack trace is printed. However in iojs 1.0.x just END is printed. This also seams to be the case for process.nextTick.

issue tracing: AndreasMadsen/trace#12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions