Skip to content

brandonmp/bunyan-ctrl-c-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I'm using at node 7.1/npm 4.2/ubuntu 16.10. not sure what this requires

Issue only occurs when piping output to the CLI, as in node index.js | bunyan

git clone https://github.com/brandonmp/bunyan-ctrl-c-issue/blob/master/index.js
cd ./bunyan-ctrl-c-issue
yarn
npm start

Should throw this:

throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at exports._errnoException (util.js:1034:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:812:14)

When running a server, this error results in the port remaining in use after the program has ostensibly ended.

To toggle ignoring EPIPE errors

Set the SHOULD_IGNORE_EPIPE const to true in index.js. This results in a diff't error but doesn't fix problem:

Error: This socket is closed
    at Socket._writeGeneric (net.js:691:19)
    at Socket._write (net.js:742:8)
    at doWrite (_stream_writable.js:329:12)
    at writeOrBuffer (_stream_writable.js:315:5)
    at Socket.Writable.write (_stream_writable.js:241:11)
    at Socket.write (net.js:669:40)
    at Logger._emit (/home/bmp/storage/code/bunyan-ctrl-c-issue/node_modules/bunyan/lib/bunyan.js:923:22)
    at Logger.info (/home/bmp/storage/code/bunyan-ctrl-c-issue/node_modules/bunyan/lib/bunyan.js:1045:24)
    at Timeout.setTimeout [as _onTimeout] (/home/bmp/storage/code/bunyan-ctrl-c-issue/index.js:40:13)
    at ontimeout (timers.js:386:14)

To make it work:

yarn remove bunyan
yarn add [email protected]
npm start

About

demo for bunyan issue #491 https://github.com/trentm/node-bunyan/issues/491

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published