Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Process won't exit on Linux #35

Closed
sebakerckhof opened this issue Dec 13, 2016 · 4 comments · Fixed by #46
Closed

Process won't exit on Linux #35

sebakerckhof opened this issue Dec 13, 2016 · 4 comments · Fixed by #46

Comments

@sebakerckhof
Copy link

I have a simple test script like:

setTimeout(() => {
  process.exit(0);
},5000);

This works 100% of the times (after 5s the node process stops).

When I now include this library, like:

const usbDetection = require('usb-detection');

usbDetection.on('add', device => { console.log('added', device); } );
usbDetection.on('remove', device => { console.log('removed', device) });

setTimeout(() => {
  process.exit(0);
},5000);

The process hangs most of the times after 5s instead of exiting.

@sebakerckhof
Copy link
Author

Seems related to: #2

@falnos24865
Copy link

falnos24865 commented Sep 28, 2017

Not sure this is related to #2. I have applied the PR listed in #2 and it fixes the 100% CPU spike, but the usb-detection module still prevents node from exiting once it is used, even after using the stopMonitoring function.

@MadLittleMods
Copy link
Owner

@sebakerckhof @falnos24865 What OS are you on? I suspect you are on Linux after experiencing something similar now.

@MadLittleMods MadLittleMods changed the title Library makes process.exit() freeze Process won't exit on Linux Nov 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants