zombocom / zombocom/rack-timeout

Detect if the middleware is already loaded and prevent it from being loaded twice

Open
#171 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
922
Forks
160
PR merge metrics
No merged PRs in 30d

Description

We're running a Rails 6 app on Heroku with rack-timeout initialized with: config.middleware.use Rack::Timeout, service_timeout: 25, wait_timeout: 25

The errors we see in our exception tracking look legit, eg:
Rack::Timeout::RequestTimeoutError (Request waited 6ms, then ran for longer than 24994ms )

However what actually happens is that the requests timeout after pretty much exactly 15 seconds every time.

From the browsers point of view:
Screenshot 2020-12-08 at 09 51 19

From the logs:
08 Dec 2020 09:26:40.810256 <190>1 2020-12-08T08:26:40.4593+00:00 app web.1 - - E, [2020-12-08T08:26:40.459200 #153] ERROR -- : source=rack-timeout id=e14e9348-e767-4b66-82aa-8c32821a0b3b wait=6ms timeout=24994ms service=15000ms state=timed_out

(note that we have timeout=24994ms but service=15000ms)

What's going on here?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the Rails middleware configuration and rack-timeout initialization described in the issue, then check the middleware stack for duplicate rack-timeout entries. Reproduce the reported 25-second timeout configuration and compare the configured service timeout with the observed 15-second value. Done means duplicate loading is detected or prevented and the timeout behavior is consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.