[CONC-225] Unable to connect using SSL and non-blocking API on slow network Created: 2017-01-15  Updated: 2017-06-17

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 2.3.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: René Cannaò Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When on a "slow network" and trying to connect to a backend using SSL and non-blocking API (mysql_real_connect_start/mysql_real_connect_cont), it results in an error "2013: Lost connection to MySQL server at 'reading authorization packet'" , due to system error 11 (Resource temporarily unavailable).

The issue seems caused by the fact that mthd_my_real_connect() calls run_plugin_auth() . This one calls net_safe_read(), that calls my_net_read() , and if this one returns "packet_error" the connection is immediatelyterminated .
my_net_read() returns "packet_error" when there is no data to read from the socket: this shouldn't be considered an error during non-blocking calls.

In other words, it seems that when establishing an SSL connection the library behaves correctly only on fast networks as data will be immediately available to read.



 Comments   
Comment by Lloyd N Kvam [ 2017-06-17 ]

I am unable to connect to Mariadb 10.1.24 on RHEL 7 from Windows 7 using the python-mysqldb library.

In looking at the source code, I see it uses nysql_real_connect. So I suspect that I am a victim of this bug.

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