-
-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First SIGINT does not cause process to exit #3657
Comments
Here is short program to reproduce:
When you run it, the first ^C destroys the driver, the second ^C is needed to stop the program.
Note that if the driver is not started correctly or has error, then the handler on Hope it helps! |
This issue has not seen any recent activity and was marked as "stale 💤". Feel free to reopen if the issue persists. |
Is your problem within Home Assistant (Core or Z-Wave JS Integration)?
NO, my problem is NOT within Home Assistant or the ZWave JS integration
Is your problem within ZWaveJS2MQTT?
NO, my problem is NOT within ZWaveJS2MQTT
Checklist
I have checked the troubleshooting section and my problem is not described there.
I have read the changelog and my problem was not mentioned there.
Describe the bug
What causes the bug?
SIGINT
is caught inzwave-js
by a handler that destroys the driver, but does not callprocess.exit
.What do you observe?
The first ^C does not kill the process. Looking at the traces, it does the cleanup on the driver, but does not exit. You need to press ^C a second time to have the process really killed.
This can be an issue when the process is a subprocess (e.g. of a shell command). Indeed, the first ^C will kill the parent process, and the zwave process will continue as a zombie.
What did you expect to happen?
The handler should also call
process.exit()
, so that the process exits on the first ^C.Steps to reproduce the behavior:
Device information
Manufacturer:
Model name:
Node ID in your network:
How are you using
node-zwave-js
?zwavejs2mqtt
Docker image (latest)zwavejs2mqtt
Docker image (dev)zwavejs2mqtt
Docker manually built (please specify branches)ioBroker.zwave2
adapter (please specify version)HomeAssistant zwave_js
integration (please specify version)pkg
node-red-contrib-zwave-js
(please specify version, double click node to find out)Which branches or versions?
version:
node-zwave-js
branch: 8.4.1zwavejs2mqtt
branch:Did you change anything?
no
If yes, what did you change?
No response
Did this work before?
Don't know, this is a new device
If yes, where did it work?
No response
Attach Driver Logfile
16:52:37.665 DRIVER ███████╗ ██╗ ██╗ █████╗ ██╗ ██╗ ███████╗ ██╗ ███████╗
╚══███╔╝ ██║ ██║ ██╔══██╗ ██║ ██║ ██╔════╝ ██║ ██╔════╝
███╔╝ ██║ █╗ ██║ ███████║ ██║ ██║ █████╗ █████╗ ██║ ███████╗
███╔╝ ██║███╗██║ ██╔══██║ ╚██╗ ██╔╝ ██╔══╝ ╚════╝ ██ ██║ ╚════██║
███████╗ ╚███╔███╔╝ ██║ ██║ ╚████╔╝ ███████╗ ╚█████╔╝ ███████║
╚══════╝ ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═══╝ ╚══════╝ ╚════╝ ╚══════╝
2021-11-03T15:52:37.657Z DRIVER
16:52:37.702 DRIVER version 8.4.1
2021-11-03T15:52:37.702Z DRIVER version 8.4.1
16:52:37.711 DRIVER
2021-11-03T15:52:37.711Z DRIVER
16:52:37.718 DRIVER starting driver...
2021-11-03T15:52:37.718Z DRIVER starting driver...
16:52:37.847 DRIVER opening serial port /dev/ttyACM0
2021-11-03T15:52:37.847Z DRIVER opening serial port /dev/ttyACM0
16:52:43.431 DRIVER serial port opened
2021-11-03T15:52:43.431Z DRIVER serial port opened
16:52:43.444 SERIAL » [NAK] (0x15)
2021-11-03T15:52:43.443Z SERIAL » [NAK] (0x15)
16:52:45.170 DRIVER loading configuration...
2021-11-03T15:52:45.169Z DRIVER loading configuration...
16:52:45.263 CONFIG version 8.4.1
2021-11-03T15:52:45.262Z CONFIG version 8.4.1
================= ^C typed here ====================================
16:52:52.200 DRIVER destroying driver instance...
2021-11-03T15:52:52.199Z DRIVER destroying driver instance...
================== process it no exited ================================
The text was updated successfully, but these errors were encountered: