Option to add a timeout for ping
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start at the library's ping implementation and compare how connect, reading, and writing timeouts are handled. Review the interaction described with SQLAlchemy's pool_pre_ping option; done means callers can configure a distinct ping timeout without changing normal read/write timeout behavior.
Written by the indexing model from the issue text.
Description
The pymsql library currently supports a timeout for connect, reading, and writing, but there isn't a specific timeout for ping.
There's an interesting interaction between this library and a more high-level one, such as sqlalchemy. Many of the default classes for connection pools in sqlalchemy often allow for a pool_pre_ping option, which will ping the connection while checking it out of the pool. If the connection does not respond or is determined to be unconnected, then the pool will fetch a brand new connection.
Conceptually, this pre-pinging is essentially acting as a connect, however there is no way to timeout quickly if the connection is hangs or is in a bad state. One could set the read/write timeout to be low, but in practice this is difficult to do, as once a transaction is open or a connection is in use, then its reasonable to tolerate some read/write lag.
While it isn't necessarily the responsibility of this library to provide a ping that uses the connect timeout, it would be great to have an option to do so.
- Dominant language
- Python
- Stars
- 7.8k
- Forks
- 1.4k
- Avg merge
- 5h 40m
- Merged PRs (30d)
- 5
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PyMySQL/PyMySQL
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Compression OpenFeature Request Priority-High
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Feature Request
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Feature Request
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·