Skip to content

socket hang up is not retried #305

@kamilglod

Description

@kamilglod

Description

When running open fga sdk with default retries configuration on production I'm occasionally getting FGA Error: socket hang up Error: socket hang up, looks like it's an error from axios library when request is timed out. Should it be added as valid case for checkIfRetryableError?

Version of SDK

v0.9.1

Version of OpenFGA (if known)

v1.11.1

Sample Code the Produces Issues

just setup client and use it with higher volume traffic (like 1k per hour)

const client = new OpenFgaClient({
    apiUrl: opts.authorization.api.apiUrl,
    storeId: opts.authorization.api.storeId,
    authorizationModelId: opts.authorization.api.modelId,
});

Backtrace (if applicable)

Internal Server Error: FGA Error: socket hang up Error: socket hang up
    at AxiosError.from (/home/app/node_modules/axios/dist/node/axios.cjs:914:14)
    at RedirectableRequest.handleRequestError (/home/app/node_modules/axios/dist/node/axios.cjs:3515:25)
    at RedirectableRequest.emit (node:events:536:35)
    at eventHandlers.<computed> (/home/app/node_modules/follow-redirects/index.js:49:24)
    at ClientRequest.emit (node:events:524:28)
    at emitErrorEvent (node:_http_client:101:11)
    at TLSSocket.socketOnEnd (node:_http_client:528:5)
    at TLSSocket.emit (node:events:536:35)
    at endReadableNT (node:internal/streams/readable:1698:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
    at Axios.request (/home/app/node_modules/axios/dist/node/axios.cjs:4731:41)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async attemptHttpRequest (/home/app/node_modules/@openfga/sdk/dist/common.js:188:30)
    at async /home/app/node_modules/@openfga/sdk/dist/common.js:226:33
    at async /home/app/node_modules/@openfga/sdk/dist/client.js:500:30
    at async /home/app/node_modules/tiny-async-pool/lib/es9.js:12:34
    at async consume (/home/app/node_modules/tiny-async-pool/lib/es9.js:4:30)
    at async asyncPool (/home/app/node_modules/tiny-async-pool/lib/es9.js:21:11)
    at async OpenFgaClient.batchCheck (/home/app/node_modules/@openfga/sdk/dist/client.js:504:26)

Expected behavior

Error should be retired

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions