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

Handle RPC disconnection gracefully #32

Open
nazar-pc opened this issue Nov 5, 2021 · 0 comments
Open

Handle RPC disconnection gracefully #32

nazar-pc opened this issue Nov 5, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@nazar-pc
Copy link
Member

nazar-pc commented Nov 5, 2021

When RPC connection drops (node is shut down or instance), relayer prints tons of the following:

2021-11-05 07:12:56        RPC-CORE: getFinalizedHead(): BlockHash:: WebSocket is not connected
2021-11-05 07:12:56        RPC-CORE: getHeader(hash?: BlockHash): Header:: WebSocket is not connected
[1636089176740] ERROR: WebSocket is not connected
    Error: WebSocket is not connected
        at assert (/web/subspace/subspace-relayer/backend/node_modules/@polkadot/util/assert.cjs:34:11)
        at /web/subspace/subspace-relayer/backend/node_modules/@polkadot/rpc-provider/ws/index.cjs:491:26
        at new Promise (<anonymous>)
        at WsProvider.send (/web/subspace/subspace-relayer/backend/node_modules/@polkadot/rpc-provider/ws/index.cjs:489:12)
        at callWithRegistry (/web/subspace/subspace-relayer/backend/node_modules/@polkadot/rpc-core/bundle.cjs:258:42)
        at Observable._subscribe (/web/subspace/subspace-relayer/backend/node_modules/@polkadot/rpc-core/bundle.cjs:265:9)
        at Observable._trySubscribe (/web/subspace/subspace-relayer/backend/node_modules/rxjs/dist/cjs/internal/Observable.js:41:25)
        at /web/subspace/subspace-relayer/backend/node_modules/rxjs/dist/cjs/internal/Observable.js:35:31
        at Object.errorContext (/web/subspace/subspace-relayer/backend/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:22:9)
        at Observable.subscribe (/web/subspace/subspace-relayer/backend/node_modules/rxjs/dist/cjs/internal/Observable.js:26:24)
2021-11-05 07:12:56        RPC-CORE: getFinalizedHead(): BlockHash:: WebSocket is not connected

Ideally it should just crash.

@nazar-pc nazar-pc added the bug Something isn't working label Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants