Skip to content

core: handle._handle.close(callback) is not idempotent #1287

@bnoordhuis

Description

@bnoordhuis

handle._handle.close(callback) is not idempotent and that's because node::HandleWrap::Close() overrides the .close method with the callback. This one-liner should print 'Trace' only once:

$ iojs -e 'var t = new (process.binding("timer_wrap").Timer); t.close(console.trace); t.close()'
Trace
    at [eval]:1:78
    at Object.exports.runInThisContext (vm.js:54:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:410:26)
    at evalScript (node.js:475:25)
    at startup (node.js:84:9)
    at node.js:867:3
Trace

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions