Option to add a timeout for ping

Abierto
#1,169 3 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
mysql, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
7.8k
Forks
1.4k
Merge medio
5 h 40 min
PR fusionados (30 d)
5

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PyMySQL/PyMySQL

Todos los issues de PyMySQL/PyMySQL

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.