Option to add a timeout for ping

Aperta
#1,169 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
mysql, python
Ambito
backend, databases

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
7.8k
Fork
1.4k
Merge medio
5h 40m
PR unite (30g)
5

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PyMySQL/PyMySQL

Tutte le issue di PyMySQL/PyMySQL

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.