Skip to content

ChainHead APIs: add option to timeout subscriptions if no events received in N seconds #2050

@jsdw

Description

@jsdw

See paritytech/polkadot-staking-miner#1119 (comment)

On occasion, these subscriptions seem to stop receiving events. It's not clear why offhand, but would be good to be able to catch and handle such failures. The obvious way to do this is having a timeout such that if no more events are received for a certain amount of time, assume something went wrong / recreate the subscription.

For now, we could add a configurable timeout in the ChainHead backend which errors out if it stops receiving events. This owuld also cover runtime updates, and anything else using the same stream.

I perhaps would add similar the the legacy APIs, though offhand can't recall if we could do something nice for runtime updates or not.

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