Skip to content
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

Ctrl-c handling in Nodejs #5071

Closed
SudershanReddy opened this issue Feb 4, 2016 · 2 comments
Closed

Ctrl-c handling in Nodejs #5071

SudershanReddy opened this issue Feb 4, 2016 · 2 comments
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. process Issues and PRs related to the process subsystem.

Comments

@SudershanReddy
Copy link

Hi, this query is in the context of applications using node-oracledb and trying control+c (SIGINT). Oracle client registers signal handler for SIGINT and it's logic is just to reset DB connection protocol and nothing more, no exiting the process. Now if there are open connections to Oracle DB in the Nodejs application and user presses control+c, we see that Oracle's signal handler is called continuously and application does not proceed. We also observe that if control+c pressed for the second time then the application exits. Can you please clarify why the signal handler is called continuously with first control+c and the program exits with second control+c? We are guessing that Node's signal handler is calling Oracle client's handler continuously assuming that it should make the program exit. And perhaps the second ctrl+c gives up and forces the program to exit?

Note: This problem is not seen till Node version 0.10.x but started from version 0.12.x onwards.

@mscdex mscdex added c++ Issues and PRs that require attention from people who are familiar with C++. process Issues and PRs related to the process subsystem. labels Feb 4, 2016
@bnoordhuis
Copy link
Member

Node.js > v0.10 installs a SIGINT handler at start-up with mode SA_RESETHAND, i.e., it's removed when the signal is raised. When a SIGINT is received, the handler resets the tty and re-raises the signal.

From your description, I speculate that the instaclient signal handler tries to chain signal handlers somehow, resulting in a loop. Perhaps it needs to be registered with SA_RESETHAND as well?

Caveat emptor: SA_RESETHAND is buggy on FreeBSD. See src/node.cc for a description of the issue and how we work around that.

@bnoordhuis
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants