[MDEV-28611] Clarify difference between ER_CONNECTION_KILLED (1927) and error 2013 Created: 2022-05-18 Updated: 2023-04-27 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Lenski | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
While writing MTR tests of procedure code, it's sometimes necessary to expect the current connection/thread to be killed. I've been using the following in my MTR .test files:
However, this occasionally results in tests failing
It would be useful to have clarity on when/why an MTR test can sometimes fail with error 2013 instead of error 1927/ER_CONNECTION_FAILED.
|
| Comments |
| Comment by Daniel Lenski [ 2022-05-18 ] | |
|
| |
| Comment by Sergei Golubchik [ 2022-06-09 ] | |
|
| |
| Comment by Sergei Golubchik [ 2022-06-09 ] | |
|
1927 (ER_CONNECTION_KILLED) is the server error code. A client can get it in the error packet. I believe mysqltest does not know about client error names, so one cannot write
and has to use the numeric error code. Why you can get either? Perhaps, if the server sends error 1927 and closes the connection, the result depends on whether the client manages to read the error packet before the connection is closed. | |
| Comment by Daniel Lenski [ 2022-06-09 ] | |
|
serg wrote:
Yes, understood.
Yes, I think this is right. It's basically a race condition. What I'm emphasizing here is that this makes it difficult to write a correct test… or a correct exception handler in any application that uses a MariaDB connector library, for that matter. If the test can randomly get either of these errors (seems to be about 90% 1927 and 10% 2013 in my case), then if you write it to only catch one of them, the test will randomly fail. Can MTR or the C API be improved so that these errors are combined? | |
| Comment by Sergei Golubchik [ 2022-06-28 ] | |
|
Yes, you're right. If my explanation is correct, then it's a bug, of course, the error should not depend on how fast host OS closes connections. And it should be fixed in the Connector/C, clients shouldn't have to write
|