Connection.is_connected raises BrokenPipe error after connection lost
Bug #918118 reported by
Sunfox
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Connector/Python |
In Progress
|
Undecided
|
Unassigned |
Bug Description
python -c "import mysql.connector as db; print db.__version__"
(0, 3, 2, 'devel', 292)
python --version
Python 2.6.5
mysql -NB -e "SELECT VERSION()"
5.5.17-55-log (using percona server)
uname -a
Linux sunfox 2.6.32-36-server #79-Ubuntu SMP Tue Nov 8 22:44:38 UTC 2011 x86_64 GNU/Linux
I lost my traceback so I cannot attach, but problem is, is_connected function trying to send data to closed socket i think. BrokenPipe error probably occured because I connect to localhost and myconnpy uses mysql socket.
To post a comment you must log in.
FYI, the code for is_conntected() and ping() has been refactored a bit in later versions.
I didn't get a BrokenPipe error, but can you check on how to reproduce it?
I do this:
>>> cnx = mysql.connector .MySQLConnectio n(database= 'test')
Now stop the MySQL server, and do:
>>> cnx.is_connected()
This gives an InterfaceError "Expected OK packet" (which might also not be that good)