Skip to content

Long requests fail after 30 seconds with context canceled #222

Closed
@toote

Description

@toote

When the service being proxied takes too long to reply, the request is cancelled and the client receives a 502

Expected Behavior

You should be able to configure a timeout for the proxied service.

Current Behavior

A request that takes over 30 seconds for a reply fails with 502 and you see the following in the logs:

2019/07/22 22:40:42 http: proxy error: context canceled
X.X.X.X - REDACTED_USER@example.com [2019/07/22 22:40:12] REDACTED_DNS GET REDACTED_UPSTREAM "REDACTED_URL" HTTP/1.1 "Mozilla/5.0 REDACTED_USER_AGENT" 502 0 30.001

Possible Solution

I am not well-versed in Go so, despite trying, I have not been able to find a solution for this issue. I assume it has something to do with the setup of the ReverseProxy

Steps to Reproduce (for bugs)

Using the latest tag in master, use an upstream that just takes too long to reply. The easiest example is a PHP service that runs the following (untested) script:

<?php
  set_time_limit(0); /* Make sure we can run for as long as necessary */
  sleep(35);
  echo "Hello World";

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions