Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

phridge.dispose causes EPIPE error after SIGINT #34

Description

@SystemParadox

test program:

var phridge = require('phridge');
var ph = phridge.spawn();
ph.then(function (ph) {
    console.log('phantomJS started');
});
process.on('SIGINT', function () {
    phridge.disposeAll().then(function () {
        console.log('phantomJS closed');
        process.exit();
    });
});

output:

phantomJS started
^C
events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: write EPIPE
    at errnoException (net.js:901:11)
    at Object.afterWrite (net.js:718:19)

Change SIGINT to SIGTERM, use a timeout or anything else to trigger the shutdown and it works fine. Maybe SIGINT closes stdin/stdout?

Interestingly it also works if I do process.emit('SIGINT').

I am using Linux (bash).

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions