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

Gestion erreur timeout pour validateur GTFS #2378

Merged
merged 3 commits into from
May 10, 2022
Merged

Conversation

AntoineAugusti
Copy link
Member

Lié à #2376

En regardant les erreurs de la validation/validation à la demande, je tombe sur un cas qui ne semble pas être traité par le code existant, le cas de timeout lors de l'appel HTTP au validateur GTFS.

La stacktrace enregistrée est

%FunctionClauseError{args: nil, arity: 1, clauses: nil, function: :handle_validation_response, kind: nil, module: Shared.Validation.GtfsValidator}

ce qui est assez cryptique. J'ai déjà vu ça dans le backoffice aussi.

La façon de gérer les timeouts avec HTTPoison est assez bancale edgurgel/httpoison#215 mais ma compréhension est que ça devrait être %HTTPoison.Error{reason: :timeout}.

@@ -74,6 +75,10 @@ defmodule Shared.Validation.GtfsValidator do
{:error, "Error while requesting GTFS validator"}
end

defp handle_validation_response({:error, _}) do
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La clause précédente faisait comme s'il y avait toujours un body, ce qui n'arrive pas en cas de timeout à la connexion ou à la réception.

@AntoineAugusti AntoineAugusti marked this pull request as ready for review May 10, 2022 13:26
@AntoineAugusti AntoineAugusti requested a review from a team as a code owner May 10, 2022 13:26
Copy link
Contributor

@thbar thbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok top ; une raison de plus d'encourager l'usage de Mint ou Finch peut-être ! En même temps HTTPoison gère beaucoup de choses encore.

Si besoin plus tard, on pourra utiliser bypass si on veut simuler un vrai timeout serveur.

@thbar thbar merged commit d314f1f into master May 10, 2022
@thbar thbar deleted the gtfs-validator-handle branch May 10, 2022 13:31
thbar added a commit that referenced this pull request Oct 31, 2022
I have Postgres 14 locally, maybe this explains this failure.
thbar added a commit that referenced this pull request Oct 31, 2022
* Add test with more chances to fail (#2378)

I have Postgres 14 locally, maybe this explains this failure.

* Sort GTFS-RT entities in deterministic order (#2376)

This lead to test failure at the very least.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants