Skip to content

option for preventing DB connections leaks#79

Open
colivi wants to merge 2 commits intohanslub42:masterfrom
colivi:master
Open

option for preventing DB connections leaks#79
colivi wants to merge 2 commits intohanslub42:masterfrom
colivi:master

Conversation

@colivi
Copy link
Copy Markdown

@colivi colivi commented Oct 15, 2017

Hi there,
Here is a small contribution that silently closes program after a given timeout (sec) has been provided as option.
This is really useful dealing with long sqlplus sessions on Oracle DB that are overloaded.
Hope that helps!
Thanks,
Charles

Comment thread src/main.c Outdated
set_echo(FALSE); /* This will also put the terminal in CBREAK mode */
test_main();

gettimeofday(&start_time, NULL);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using clock_gettime(CLOCK_MONOTONIC) instead gettimeofday. Using gettimeofday can result in erratic behavior if NTP decides to adjust the system clock, for example.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, thanks !
I was tempted to use CLOCK_MONOTONIC_RAW, but it's Linux specific

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants