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
Add connection retry interval and support timeout for pvio_socket_internal_connect
#204
Conversation
…ternal_connect` There's an infinite loop in function `pvio_socket_internal_connect` to retry connection forever if receiving specific errno number: - No retry interval in the loop which will cause the process consuming all CPU usage and slowdown/stuck other processes. - Even if the timeout was set in `mysqladmin` command option, the function will retry forever in the infinite loop. The issue was seen a few times when MariaDB server was hanging and not accepting new connection correctly. When the issue happened `mysqladmin` process consumed 100% CPU usage and stack trace shows it stuck in the loop. Though `--connect_timeout` was set in command line, `mysqladmin` will never end until a force kill was executed. In this commit a retry interval is added in the loop to avoid exhausting the CPU resource. Also it will check the elapsed time in the loop and break if it passed the timeout threshold. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
|
Add the detailed |
|
Thank you for your contribution. Issue filed: CONC-607 Since it is a bug and not a new feature I will fix it in 3.1 first, then merging to 3.3 (3.2 is discontinued). |
|
pushed into 3.1 and merged into 3.3 |
|
@9EOR9 This was not nice: dfe3563 You should merge the original commit and not infringe on copyright and take ownership of it. If you want it to be rebased on another branch etc, then ask the submitter to rebase. If the submitter is unresponsive (which was not the case here, but could be in another case) then at least cherry-pick the commit and keep authorship. What you now did is a copyright violation. |
|
In addition to what @ottok wrote, @HugoWenTD's original commit message contained a great deal more background information about how and why this change was made; preserving that thorough message in the history would be much more useful to anyone trying to modify or debug this code, e.g. with |
|
@9EOR9 Can you please revert the commit you did wrongly and include the proper commit? Thanks |
|
@LinuxJedi Could you please assist here to rectify the error? |
Hi @ottok, Unfortunately Connector/C is a MariaDB Corporation project (hence the mariadb-corporation GitHub organization for the tree), outside the control of the Foundation. I will, however, try and ping people inside the Corporation to see if I can get you an answer here. |
|
I don't think the commit takes ownership of @HugoWenTD code, on the opposite, it clearly says who the author is. I hope in the future @9EOR9 will use commits from PR as is. But I don't see there's a need to add garbage to the history by reverting and recommitting the same change over and over. |
@vuvova Yes, it clearly takes away the authorship. Compare these two options @9EOR9 could have done: Option 1: Apply original commit and keep authorship and commit message Option 2: Take code, add whitespace and rewrite author and commit message Georg's version is a 1:1 copy of Hugo's submission, only one whitespace character is added to the end. Clearly option 1 would have been better. We reported this violation to you within 24 hours of Georg making it on July 25th. Additionally we reminded about this open violation again on August 9th and you didn't do anything to rectify it.
We are not asking to do anything 'over and over'. We just asked to fix one problem, once. It is a recurring problem only if you make it several times. |
|
I hope in the future @9EOR9 will use commits from PR as is. |
Add connection retry interval and support timeout for
pvio_socket_internal_connectThere's an infinite loop in function
pvio_socket_internal_connecttoretry connection forever if receiving specific errno number:
CPU usage and slowdown/stuck other processes.
mysqladmincommand option, the functionwill retry forever in the infinite loop.
The issue was seen a few times when MariaDB server was hanging and not
accepting new connection correctly. When the issue happened
mysqladminprocess consumed 100% CPU usage and stack trace shows it stuck in the
loop. Though
--connect_timeoutwas set in command line,mysqladminwill never end until a force kill was executed.
In this commit a retry interval is added in the loop to avoid exhausting
the CPU resource. Also it will check the elapsed time in the loop and
break if it passed the timeout threshold.
All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.