PyMySQLPool
PyMySQLPool copied to clipboard
Ping '__ping_check_timestamp' attributes is turned to '_Pool__ping_check_timestamp'
$ python -V Python 3.6.8
Debug Log
(Pdb)
/usr/local/lib/python3.6/site-packages/pymysqlpool/pool.py(177)__get_safe_conn() -> if not hasattr(c, '__ping_check_timestamp'): (Pdb) old_attributes = set(vars(c).keys()) /usr/local/lib/python3.6/site-packages/pymysqlpool/pool.py(178)__get_safe_conn() -> c.__ping_check_timestamp = now (Pdb) n /usr/local/lib/python3.6/site-packages/pymysqlpool/pool.py(179)__get_safe_conn() -> try: (Pdb) cur_attributes = set(vars(c).keys()) (Pdb) old_attributes {'encoding', 'host_info', 'unix_socket', '_rfile', '_connect_attrs', 'cursorclass', 'server_capabilities', 'server_public_key', 'db', '_closed', 'client_flag', '_write_timeout', 'encoders', 'init_command', 'server_charset', 'server_status', 'password', 'host', '_result', 'port', 'ssl', '_affected_rows', 'sql_mode', 'autocommit_mode', 'user', 'use_unicode', 'server_language', 'server_thread_id', '_auth_plugin_map', '_next_seq_id', '_read_timeout', 'protocol_version', 'bind_address', 'salt', 'max_allowed_packet', '_local_infile', 'server_version', 'connect_timeout', 'charset', '_sock', '_auth_plugin_name', '_binary_prefix', 'decoders'} (Pdb) cur_attributes {'encoding', 'host_info', '_Pool__ping_check_timestamp', 'unix_socket', '_rfile', '_connect_attrs', 'cursorclass', 'server_capabilities', 'server_public_key', 'db', '_closed', 'client_flag', '_write_timeout', 'encoders', 'init_command', 'server_charset', 'server_status', 'password', 'host', '_result', 'port', 'ssl', '_affected_rows', 'sql_mode', 'autocommit_mode', 'user', 'use_unicode', 'server_language', 'server_thread_id', '_auth_plugin_map', '_next_seq_id', '_read_timeout', 'protocol_version', 'bind_address', 'salt', 'max_allowed_packet', '_local_infile', 'server_version', 'connect_timeout', 'charset', '_sock', '_auth_plugin_name', '_binary_prefix', 'decoders'} (Pdb) cur_attributes - old_attributes {'_Pool__ping_check_timestamp'}
because of this, the Ping Check fails, This needs to be fixed?
I have the same problem. The fix by @mindflayer seems good, so I wish it was merged to master and PyPI's package was updated. Wouldn't @mindflayer create its pull request? Or wouldn't the maintainer merge it by their hand?