MySQL Forums
Forum List  »  Connector/Python

Propose improvements to the implementation of MySQLTCPSocket.open_connection
Posted by: SHINICHI TAKAYANAGI
Date: November 08, 2020 11:08PM

In the current implementation, it raises an error immediately if a process fails at an ip address.
Why don't all element in addrinfos try to connect at first and throw an exception?
( The current implementation: https://github.com/mysql/mysql-connector-python/blob/403535dbdd45d894c780da23ba96b1a6c81e3866/lib/mysql/connector/network.py#L607 )

For example, if we use the --add-host=localhost:<local-ip-address> option when launch docker container,
it would insert the specified IP address in /etc/hosts.
However, the process connecting to mysql-db using mysql-connector-python fails in the current implementation when accessing 127.0.0.1 (which is usually set up) and the inserted ip adress are not used to access.

SHINICHI TAKAYANAGI

Options: ReplyQuote


Subject
Written By
Posted
Propose improvements to the implementation of MySQLTCPSocket.open_connection
November 08, 2020 11:08PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.