fix: disable_unhealthy_flow_schedules and _check_for_updates#989
Merged
Conversation
6 tasks
Winzen
added a commit
that referenced
this pull request
Feb 26, 2026
## Descrição das Alterações Este Pull Request tem como objetivo atualizar a branch atual com as últimas alterações da branch main, garantindo que a base de código esteja alinhada com as mudanças mais recentes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: disable_unhealthy_flow_schedules and _check_for_updates
disable_unhealthy_flow_schedules
No Prefect foi identificado um comportamento intermitente na desativação de schedules.
Devido a uma race condition entre o scheduler e a API, quando o scheduler ainda está processando ticks no momento da mutation, o schedule pode não ser efetivamente desativado na primeira chamada — mesmo retornando
success.Isso fazia com que flows considerados não saudáveis continuassem gerando novas execuções, exigindo nova tentativa manual para efetivar a desativação.
Foi implementada uma segunda tentativa imediata de desativação do schedule para cada flow validado como unhealthy:
Essa abordagem mitiga a race condition do scheduler e garante que o schedule seja efetivamente desativado, tornando o processo determinístico e evitando a necessidade de reexecução manual.
check_for_updates
Foi identificado um erro na função check_for_updates. Algumas tables não possuem o atributo last_updated_at, o que gerava exceção durante a comparação e interrompia o fluxo normal da execução.
Também foi ajustada a função check_for_updates para tratar casos onde table.last_updated_at não está presente, evitando que a ausência desse atributo gere exceção e quebre a execução. Agora, nesses casos, a função trata o erro de forma segura e retorna False, preservando a estabilidade do processo.