Bug #80238 Large queries fail with error "mysql.connector.errors.OperationalError: 2055"
Submitted: 2 Feb 2016 15:27 Modified: 5 Feb 2016 14:52
Reporter: Mo Al Deiri Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / Python Severity:S2 (Serious)
Version:2.1.3 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: 2055, OperationalError

[2 Feb 2016 15:27] Mo Al Deiri
Description:
Using the Python MySQL connector I notice that any large query I submit seems to fail with the following error:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/mysql/connector/network.py", line 212, in send_compressed
    self.sock.sendall(zip_packet)
BlockingIOError: [Errno 35] Resource temporarily unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/threading.py", line 921, in _bootstrap_inner
    self.run()
  File "/Users/maldeiri/raw_data_processing/sql_retriever.py", line 22, in run
    self.mysql_cursor.execute(self.sql_statement)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/mysql/connector/cursor.py", line 515, in execute
    self._handle_result(self._connection.cmd_query(stmt))
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/mysql/connector/connection.py", line 488, in cmd_query
    result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/mysql/connector/connection.py", line 261, in _send_cmd
    packet_number)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/mysql/connector/network.py", line 215, in send_compressed
    errno=2055, values=(self.get_address(), _strioerror(err)))
mysql.connector.errors.OperationalError: 2055: Lost connection to MySQL server at 'database_end_point:3306', system error: 35 Resource temporarily unavailable

I have tried using the compress flag setting it to both true and false, however this doesn't resolve the problem. 

I know this is a problem with the connector as using the pymysql library doesn't cause any errors for the same queries, client machine and Database. 

How to repeat:
Create very large Select statements, for example "select * from table_1 where column_1 in (val_1, val_2.... val_350,000)"

As I mentioned this only seems to happen when using the MySQL connector and doesn't happen with other libraries.
[5 Feb 2016 10:15] Chiranjeevi Battula
Hello Mo Al Deiri,

Thank you for the bug report.
This is most likely duplicate of Bug #77622, Please see Bug #77622.

Thanks,
Chiranjeevi.
[5 Feb 2016 14:52] Mo Al Deiri
Hi,

I don't think it's a replicate but if you think it is, can you explain how it is?

As I mentioned, if I use the pymysql library for the exact same query, I don't run into this problem. This only happens with the python/ connector library. 

thanks