Skip to content

What to do about timeouts? #6

@tlimoncelli

Description

@tlimoncelli

When doing large updates (for example, creating 20 A records) I sometimes get this error:

Post "https://api.name.com/v4/domains/dnscontrol-ndc.com/records": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Ideally the library should silently retry, or at least provide enough feedback so that I can do the re-try.

sadly doing my own retry didn't work. I tried this but got the error Invalid Argument: Parameter Value Error - Dns Error:

+       if err != nil {
+               if strings.Contains(err.Error(), "context deadline exceeded") {
+                       fmt.Printf("INFO: Sleeping then re-trying due to error: %s\n", err)
+                       time.Sleep(1 * time.Second)
+                       goto retry
+               }
+       }

Suggestions on how to handle this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions