[MDEV-14131] Burst in connections may show: Lost connection to MySQL server at 'handshake: reading inital communication packet', system error: 22 Created: 2017-10-26  Updated: 2020-12-01

Status: Confirmed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.1, 10.2.9
Fix Version/s: 10.2

Type: Bug Priority: Major
Reporter: Andrii Nikitin (Inactive) Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-14103 Testing for group commit in MyRocks Closed

 Description   

Often happens in load test



 Comments   
Comment by Andrii Nikitin (Inactive) [ 2017-10-26 ]

The problem is the easiest to reproduce on freshly started server, but it may happen after some uptime (the more idle server had, the easiest to reproduce) as well.

Start server with max_connections=600 and use script with following content to generate burst of 600 simultaneous connections:

set -e
# make sure that all spawned processes are cleaned up
trap "exit" INT TERM
trap "kill 0" EXIT
 
# clean up previous logs
rm -f test14131*.log
 
for i in {1..600} ; do
  ( mysql -e "select 1" &> test14131-$BASHPID.log ) &
done
 
sleep 1
mysql -e 'show global status like "Aborted%"'
echo number of erros: "$(grep 'system error: 22' test14131*.log  | wc -l)"

a@UBINTI:~/env1$ m7-system2/shutdown.sh 
a@UBINTI:~/env1$ m7-system2/startup.sh 
171026 16:35:36 mysqld_safe Logging to '/home/a/env1/m7-system2/dt/error.log'.
171026 16:35:36 mysqld_safe Starting mysqld daemon with databases from /home/a/env1/m7-system2/dt
mysqld is alive
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 0     |
+------------------+-------+
number of errors: 0
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 0     |
+------------------+-------+
number of errors: 0
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 4     |
+------------------+-------+
number of errors: 46
a@UBINTI:~/env1$ m7-system2/shutdown.sh 
a@UBINTI:~/env1$ m7-system2/startup.sh 
171026 16:36:12 mysqld_safe Logging to '/home/a/env1/m7-system2/dt/error.log'.
171026 16:36:12 mysqld_safe Starting mysqld daemon with databases from /home/a/env1/m7-system2/dt
mysqld is alive
a@UBINTI:~/env1$ pidof bash
5757 5030 3777
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 0     |
+------------------+-------+
number of errors: 250
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 0     |
+------------------+-------+
number of errors: 0
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 0     |
+------------------+-------+
number of errors: 0
a@UBINTI:~/env1$ m7-system2/shutdown.sh 
a@UBINTI:~/env1$ m7-system2/startup.sh 
171026 16:36:49 mysqld_safe Logging to '/home/a/env1/m7-system2/dt/error.log'.
171026 16:36:49 mysqld_safe Starting mysqld daemon with databases from /home/a/env1/m7-system2/dt
mysqld is alive
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 0     |
+------------------+-------+
number of errors: 161
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 0     |
+------------------+-------+
number of errors: 0
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 0     |
+------------------+-------+
number of errors: 49
a@UBINTI:~/env1$ bash spawn_sql.sh
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| Aborted_clients  | 0     |
| Aborted_connects | 0     |
+------------------+-------+
number of errors: 0

Generated at Thu Feb 08 08:11:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.