Description:
When the socket recv() call is interrupted by an EINTR, the MySQL Python connector catches the resulting Python `IOError` and raises its own `OperationalError` exception, which does not include the `IOError.errno` field and does not reference the original `IOError` (for an example, see the `mysql.connector.network.recv_plain` method.)
We would like to retry the network call on EINTR; however, there's no reliable way to detect it at the moment. The closest we can get is searching the OperationalError message string for the words "system error: 4 Interrupted system call". However, this message looks to be locale-specific, and it might change in a future product version, so the method doesn't seem future-proof.
How to repeat:
Launch a long-running MySQL query using the connector, then send a signal to the Python process.
Suggested fix:
Either reference the original IOError in the OperationalError object, or set the `errno` field when raising the exception.