Skip to content

Help needed configuring retries in combination with timeouts #1603

@williamcoates

Description

@williamcoates

What would you like to discuss?

I am load testing our platform, and in a run I usually get a handful of dns lookup errors (since it opens socket but doesnt finish the lookup):

{
  "name":"TimeoutError",
  "code":"ETIMEDOUT",
  "timings":
     {
        "start":1612969156746,
        "socket":1612969156746,
        "error":1612969166750,
        "phases":{"wait":0,"total":10004}
    },
 "event":"request"
 }

I have this configuration:

    got.extend({
      dnsCache: cacheable,
      cache: httpCache,
      responseType: 'json',
      resolveBodyOnly: true,
      retry: {
        limit: 3,
        maxRetryAfter: 10000
      },
      timeout: {
        lookup: 1000,
        request: 10000
    })

I was trying to use got to retry after one second if there is a lookup failure, but when I add retry hooks I don't see any retries being attempted. So it seems like the lookup timeout is not causing a retry at all, but instead it is waiting to 10s and then not retrying because its already reached maxRetryAfter.

Is what I am trying to achieve not currently supported?

Checklist

  • I have read the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions