Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Websocket blocks after terminating without unsubscribing  #821

@thomas-nguy

Description

@thomas-nguy

Describe the bug
As discussed on Discord https://discord.com/channels/783264383978569728/783264902613565450/907267013028749322

It was discovered that subscribing to WS works.

However, if a subscription is not unsubscribed and the session is terminated, then the WS blocks up and no further requests will be entertained. It doesn't help to reconnect and unsubscribe.

Also, in the instance where 2 clients are connected and if Client A terminates the session without unsubscribing, Client B blocks as well, and the whole WS blocks.

To Reproduce
Steps to reproduce the behavior:

  1. Have a local node running
  2. On CLI wscat -c ws://localhost:8546 (response connected)
  3. {"jsonrpc":"2.0", "id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]} (respond with suscription id)
  4. Ctrl+C to force exit
  5. Repeat 2-3, no response in step 3
  6. Restart node
  7. Repeat steps 2-3
  8. {"id": 1, "method": "eth_unsubscribe", "params": ["(subscriptionid)"]}
  9. Ctrl+C to exit.
  10. Repeat steps 2-3, subscription works

Expected behavior
WS should handle disconnection without blocking.

Screenshots
NA

Desktop (please complete the following information):
Node is Linux

Original issue
crypto-org-chain/cronos#207

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