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

Payload timeout must be shorter than socket timeout #4122

Closed
kobelb opened this issue Jul 23, 2020 · 0 comments · Fixed by #4123
Closed

Payload timeout must be shorter than socket timeout #4122

kobelb opened this issue Jul 23, 2020 · 0 comments · Fixed by #4123
Labels
support Questions, discussions, and general support
Milestone

Comments

@kobelb
Copy link
Contributor

kobelb commented Jul 23, 2020

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: v12.9.0
  • module version with issue: @hapi/hapi 19.2.0
  • last module version without issue: N/A
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): standalone
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

Configuring a route with route.options.timeout.socket smaller than route.options.payload.timeout

 server.route({
        method: 'POST',
        path: '/',
        options: {
            payload: {
                timeout: 1000
            },
            timeout: {
                socket: 200
            }
        },
        handler: (request, h) => {
            return 'Hello World!';
        }
    });

What was the result you got?

Causes the following error to be throw:

AssertionError [ERR_ASSERTION]: Payload timeout must be shorter than socket timeout

What result did you expect?

I expected to be able to configure the route.options.timeout.socket to be smaller than route.options.payload.timeout. The payload timeout controls the total payload reception time; where-as route.options.timeout.socket is actually the "idle socket timeout", not the "total time socket is open timeout". For example, we should be able to configure the payload to be sent within 1 second, while ensuring that the socket isn't idle for 500ms during the entire duration of the request and response.

@kobelb kobelb added the support Questions, discussions, and general support label Jul 23, 2020
@cjihrig cjihrig added this to the 20.0.0 milestone Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants