Refactor connection errors
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
Comece rastreando a hierarquia de exceções e os pontos de entrada de conexão mencionados na issue: connect(), handshake() e _opt_reconnect(). Revise NetworkError, OperationalError, SchemaReloadException, Warning, NetworkWarning e ClusterDiscoveryWarning; em seguida, compare o comportamento solicitado da hierarquia e das mensagens com o padrão relevante de Database API. O trabalho estará concluído quando os erros restantes do conector e as falhas de reconexão seguirem a hierarquia pretendida e o comportamento dos avisos estiver definido e coberto.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
NetworkError is the case of OperationalError in fact. Moreover, .execute() can raise NetworkError and it'll contradict to the standard if NetworkError will not be a child of OperationalError:
The module should make all error information available through these exceptions or subclasses thereof:
The standard says "should" (not "must"), but I guess it may be important if an application or a library implements some retrying strategy based on a type of an error. OperationalError is transient by its meaning and can be retried.
SchemaReloadException also looks as a child of OperationalError. It should not be visible for a user, but while we have the whole hierarchy implement, it looks meaningful to either move SchemaReloadException outside of it or inherit properly.
More generally, all errors that base connector raises should be within this hierarchy, otherwise it will not be userful in practice. I left separate comments for other standard errors, where existing errors should be child of them.
=============
The Warning class is not used anywhere now and is not connected to existing NetworkWarning and ClusterDiscoveryWarning warnings. Now those warnings are just emitted using standard warnings module (see warn() function below), but it is not flexible enough to implement Cursor.messages and Connection.messages Database API extensions. We should provide API for tarantool.connection that allows to redefine this behaviour and collect those warnings after a request as sequence of tuples (exception class, exception value) as defined in the Database API. It'll be base for implementing the Database API <...>.messages extensions.
It is unclear for me, whether 'exception class' should be a subclass of this Warning class or warnings.UserWarning (we should inherit it from StandardError, not warnigns.Warning, which in a child of Exception). It is unclear, what exatcly 'exception value' should be: an instance of this Warning class or arbitrary value that describes what exactly appears? I would look to other implementations to better understand the idea of the standard.
=============
self.handshake() call in _opt_reconnect() should be try-catched and its error should be wrapped into NetworkError like it is done in connect(). Otherwise Exception or ValueError may lift up to a user, which is not expectable I guess.
Maybe there are other similar places, need to look around the code.
- Linguagem predominante
- Python
- Estrelas
- 108
- Forks
- 51
- Merge médio
- 1d 8h
- PRs com merge (30d)
- 1
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de tarantool/tarantool-python
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
tarantool/tarantool-python#325 · 1 comentário ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
tarantool/tarantool-python#340 ·
-
`load_schema` raceAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
tarantool/tarantool-python#333 ·
-
3sp feature teamE
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
tarantool/tarantool-python#309 · 1 comentário ·
-
customer Database API
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 45/100
tarantool/tarantool-python#307 · 1 comentário ·
Todas as issues de tarantool/tarantool-python
Issues semelhantes
-
correction metadata
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
acl-org/acl-anthology#10104 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug status/needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
prowler-cloud/prowler#12885 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Bug in GaussianTailProbabilityCalibrator: running_statistics=False still uses a windowed varianceAbertabug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
selimfirat/pysad#107 ·
Mantenedores costumam responder em até 1 dia
-
bug ci-failure high priority
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
vllm-project/vllm-omni#8194 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia