Skip to content

Ping '__ping_check_timestamp' attributes is turned to '_Pool__ping_check_timestamp' #16

Open

Description

@abhishekp-uc

$ 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?

Activity

  1. added a commit that references this issue on Oct 9, 2020
  2. y-ishida commented on Apr 16, 2021

    @y-ishida

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions