Description:
Hi,
I have the following problem using the C client library: even using MYSQL_OPT_CONNECT_TIMEOUT (set to 4), whenever there is a server network instability event, the connect function hangs indefinitely. Here is a core dump of the process that called the mysql library, which was stuck for more than 20 minutes:
```
#0 __libc_read (nbytes=5, buf=0x7fd88c0107d3, fd=43) at ../sysdeps/unix/sysv/linux/read.c:26
#1 __libc_read (fd=43, buf=0x7fd88c0107d3, nbytes=5) at ../sysdeps/unix/sysv/linux/read.c:24
#2 0x00007fd8c4fbe389 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#3 0x00007fd8c4fb962e in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#4 0x00007fd8c4fb8484 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#5 0x00007fd8c4fb8a57 in BIO_read () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#6 0x00007fd8c3e64b91 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#7 0x00007fd8c3e68e1e in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#8 0x00007fd8c3e666d0 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#9 0x00007fd8c3e99901 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#10 0x00007fd8c3e8f525 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#11 0x00007fd8c3e7ad58 in SSL_do_handshake () from /lib/x86_64-linux-gnu/libssl.so.1.1
#12 0x00007fd8c4064a60 in ?? () from /lib/x86_64-linux-gnu/libmysqlclient.so.21
#13 0x00007fd8c4014195 in ?? () from /lib/x86_64-linux-gnu/libmysqlclient.so.21
#14 0x00007fd8c401448e in ?? () from /lib/x86_64-linux-gnu/libmysqlclient.so.21
#15 0x00007fd8c4017b99 in mysql_real_connect () from /lib/x86_64-linux-gnu/libmysqlclient.so.21
```
I am not sure how the timeouts I set in the mysql library affects the SSL library timeouts, maybe it is related?
Thanks in advance.
How to repeat:
I could not reproduce yet, since reproducing the same network conditions is hard. This has happened 3 times in the last 2 days.