Joystream / joystream

Joystream Monorepo
http://www.joystream.org
GNU General Public License v3.0
1.42k stars 115 forks source link

[Argus] `HEAD assets` & `GET assets` requests hang indefinitely if QN is unavailable #4771

Closed zeeshanakram3 closed 10 months ago

zeeshanakram3 commented 1 year ago

Issue

While investigating #4762 & #4760 I found that HEAD assets/{id} & GET assets/{id} requests to storage-node hang indefinitely if QN is unavailable AND asset does not exist in the local state

Argus logs the following unhandled exception on the console:

2023-05-23 15:12:26:1226 QueryNodeApi error: Error when trying to execute a query!
{
    "err": {
        "message": "request to http://graphql-server:8081/graphql failed, reason: getaddrinfo ENOTFOUND graphql-server",
        "networkError": {
            "message": "request to http://graphql-server:8081/graphql failed, reason: getaddrinfo ENOTFOUND graphql-server",
            "type": "system",
            "errno": "ENOTFOUND",
            "code": "ENOTFOUND"
        }
    }
}
(node:29) UnhandledPromiseRejectionWarning: Error: request to http://graphql-server:8081/graphql failed, reason: getaddrinfo ENOTFOUND graphql-server
    at new ApolloError (/joystream/node_modules/@apollo/client/errors/index.js:29:28)
    at /joystream/node_modules/@apollo/client/core/QueryManager.js:616:19
    at both (/joystream/node_modules/@apollo/client/utilities/observables/asyncMap.js:16:53)
    at /joystream/node_modules/@apollo/client/utilities/observables/asyncMap.js:9:72
    at new Promise (<anonymous>)
    at Object.then (/joystream/node_modules/@apollo/client/utilities/observables/asyncMap.js:9:24)
    at Object.error (/joystream/node_modules/@apollo/client/utilities/observables/asyncMap.js:17:49)
    at notifySubscription (/joystream/node_modules/zen-observable/lib/Observable.js:140:18)
    at onNotify (/joystream/node_modules/zen-observable/lib/Observable.js:179:3)
    at SubscriptionObserver.error (/joystream/node_modules/zen-observable/lib/Observable.js:240:7)
(node:29) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 46)

Expected Behavior

The requests should respond with error message & code instead of handing forever.

kdembler commented 10 months ago

@zeeshanakram3 are you aware whether this is still present in Subsquid based Argus?

zeeshanakram3 commented 10 months ago

@zeeshanakram3 are you aware whether this is still present in Subsquid based Argus?

Tested and this issue is not present in Subsquid based Argus node, so closing this