Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tornar a aplicação resilitente a indisponibilidade momentânea do banco #149

Open
augusto-herrmann opened this issue Jan 6, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@augusto-herrmann
Copy link
Member

Instablidades na infraestrutura têm deixado a API indisponível, quando o banco cai. Mesmo após o retorno do banco, a API não retorna. Segue o log do banco Postgres:

2025-01-05 09:11:39.212 GMT [80] LOG:  database system was interrupted; last known up at 2025-01-05 03:05:04 GMT
2025-01-05 09:11:39.242 GMT [80] LOG:  database system was not properly shut down; automatic recovery in progress

A inicialização da aplicação da API falha se o banco não estiver disponível:

psycopg.OperationalError: connection failed: connection to server at "**.**.**.**", port 5432 failed: FATAL:  the database system is shutting down
(Background on this error at: https://sqlalche.me/e/20/e3q8)

ERROR:    Application startup failed. Exiting.

A aplicação precisa ter resiliência e tentar novamente se inicializar algumas vezes, caso o banco de dados não esteja disponível.

@augusto-herrmann augusto-herrmann added the enhancement New feature or request label Jan 6, 2025
@augusto-herrmann augusto-herrmann changed the title Criar _retry_ para a aplicação quando o banco não estiver disponível Tornar a aplicação resilitente a indisponibilidade momentânea do banco Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant