Bug #82019 | Is client library supposed to retry EINTR indefinitely or not | ||
---|---|---|---|
Submitted: | 27 Jun 2016 14:04 | Modified: | 12 Aug 2016 17:12 |
Reporter: | Laurynas Biveinis (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Connection Handling | Severity: | S3 (Non-critical) |
Version: | 5.5, 5.6, 5.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | EINTR, libmysql |
[27 Jun 2016 14:04]
Laurynas Biveinis
[27 Jun 2016 17:06]
MySQL Verification Team
Hi Laurynas, Your analysis is quite correct. Let me introduce you to the history of this part of code. Some early Linux kernels, most of all Red Hat ones, did send a lot of EINTR which were to be ignored. Situation is fixed now and OS function `recv` is called in the VIO layer. This, however requires to be documented properly.
[27 Jun 2016 19:19]
Laurynas Biveinis
One thing I have seen was that running at least one client program (5.5 mysqlimport) with AddressSanitizer apparently makes it observe enough EINTRs to abort early
[28 Jun 2016 4:54]
MySQL Verification Team
perhaps this is interesting too: http://bugs.mysql.com/bug.php?id=81258 (please document the mysql_options() MYSQL_OPT_RETRY_COUNT)
[28 Jun 2016 14:07]
MySQL Verification Team
This should be all fixed in 5.7.
[11 Jul 2016 14:05]
Larry Adams
Can someone be specific on what versions of the various clients this is fixed in? Is it MySQL 5.5-XX, MySQL 5.6-XX, MySQL 5.7-XX? I'm using version 5.7-12-1, and do not see either the references to MYSQL_OPT_RETRY_COUNT, or the blocking of EINTR calls, and the workaround is ..... horrible.
[12 Jul 2016 13:55]
MySQL Verification Team
Hi, Due to the series of unfortunate mishaps, this bug has yet to be fixed in 5.5, 5.6 and 5.7. You will be informed on this page when it is achieved.
[15 Jul 2016 13:22]
Laurynas Biveinis
Bug 82019 fix for 5.5 (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug82019-5.5.patch (application/octet-stream, text), 1.06 KiB.
[15 Jul 2016 13:23]
Laurynas Biveinis
Bug 82019 fix for 5.6 (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug82019-5.6.patch (application/octet-stream, text), 898 bytes.
[15 Jul 2016 13:23]
Laurynas Biveinis
Bug 82019 fix for 5.7 (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bug82019-5.7.patch (application/octet-stream, text), 893 bytes.
[15 Jul 2016 13:40]
Larry Adams
Thanks for that. Can Oracle provide a release schedule for these updates? TheWitness
[15 Jul 2016 14:08]
MySQL Verification Team
Laurynas, Thank you for your contributions, which are welcome although we made lots of progress already. When the changes will be pushed , this bug report will be closed by Development , with the info of the releases where the patches are pushed into.
[12 Aug 2016 17:12]
Paul DuBois
Posted by developer: Noted in 5.5.52, 5.6.34, 5.7.15 changelogs. EINTR handling in the client library has been fixed so that interrupted read and write calls are retried. Previously, EINTR was ignored.
[12 Aug 2016 17:17]
Paul DuBois
5.6.33, not 5.6.34.
[12 Aug 2016 18:16]
Larry Adams
Thanks everyone for getting this critical bug addressed!
[31 Aug 2016 12:51]
Ståle Deraas
Thanks Laurynas for the contributions. We changed them a bit.
[22 Sep 2016 21:18]
Larry Adams
I just tested using 5.7.15, and this is NOT fixed in the client library. Darn. I'm still receiving EINTR errors for various client calls. I can reproduce 100% of the time. I someone in Oracle would like a test case, you can reach out via my registered email. Can we please re-open this ticket? TheWitness
[22 Sep 2016 22:14]
Larry Adams
Adding additional information. The error seems to be taking place in the mysql_real_connect() call only at the moment. The other API calls are behaving better now. Looking into that code, is it also using the vio subsystem?
[22 Sep 2016 22:43]
Roel Van de Paar
Larry, your best bet is to always open a new bug. Re-opening a bug is highly unlikely to happen.
[22 Sep 2016 22:43]
Roel Van de Paar
If you do, please add the URL here for tracking.
[22 Sep 2016 22:46]
Larry Adams
Sure. I'm digging into the code right now. Very little documentation. At some point I'll either have an aha moment, or go eat dinner. Either way, I'll open a new bug and link.
[22 Sep 2016 23:20]
Larry Adams
Here is a link to the new bug. Suspecting somewhere in the low level stuff net_serv.c still. But no idea where. http://bugs.mysql.com/bug.php?id=83109