elixir-tesla / elixir-tesla/tesla

Timeout bigger than 5s does not work with hackney adapter

Open
#151 15 comments 6 reactions 0 assignees View on GitHub
bug :fire: hackney stale:keep workaround
Dominant language
Elixir
Stars
2.1k
Forks
365
Avg merge
4h 14m
Merged PRs (30d)
24

Description

In hackney version 1.3.1 they've reduced the default `recv_timeout` from infinity to 5s ([source](https://github.com/benoitc/hackney/blob/master/NEWS.md))

So, if you use `Tesla.Middleware.Timeout` with timeout bigger than 5s hackney will timeout regardless of your timeout.
A solution is to pass that `recv_timeout` to hackney's request method as [HTTPoison does](https://github.com/edgurgel/httpoison/blob/64c58d0683aeee3ed1b244893d8780960de99555/lib/httpoison/base.ex#L452)

There is no problem with the default `httpc` adapter as its default timeout is `infinity`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.