Skip to content

Occasional panick when closing ws connection in CLI  #1308

@Kailai-Wang

Description

@Kailai-Wang

We notice in our CI that sometimes direct_api.close().unwrap() panicks:

integritee-indirect-invocation-demo  | [2023-05-15T12:59:06Z DEBUG itc_rpc_client::ws_client] Closing connection
integritee-indirect-invocation-demo  | [2023-05-15T12:59:06Z DEBUG itc_rpc_client::ws_client] Connection is closed
integritee-indirect-invocation-demo  | [2023-05-15T12:59:06Z DEBUG integritee_cli::trusted_operation] do watch is false, closing connection
integritee-indirect-invocation-demo  | [2023-05-15T12:59:06Z DEBUG itc_rpc_client::ws_client] Web-socket close
integritee-indirect-invocation-demo  | [2023-05-15T12:59:06Z DEBUG itc_rpc_client::ws_client] Closing connection
integritee-indirect-invocation-demo  | thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: WsClientError(WS Error <Queue(Disconnected)>)', cli/src/trusted_operation.rs:245:44
integritee-indirect-invocation-demo  | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
integritee-indirect-invocation-demo  | [2023-05-15T12:59:06Z DEBUG itc_rpc_client::ws_client] Closing connection
integritee-indirect-invocation-demo  | [2023-05-15T12:59:06Z ERROR itc_rpc_client::direct_client] Failed to close web-socket connection: WsClientError(WS Error <Queue(Disconnected)>)
Aborting on container exit...

The status was InSidechainBlock with do_watch = false.

Btw do we have any reason not returning None after the connection is closed here?

direct_api.close().unwrap();

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