Skip to content

Tokio runtime shutdown does not abort tasks created via spawn_blocking #1007

Description

@tankyleo

In case these tasks never exit, this can cause Tokio runtime shutdown to hang indefinitely.

This is currently manifested here, which causes the 0FC Integration Tests to frequently time out:

ldk-node/src/lib.rs

Lines 339 to 346 in abbed3e

self.runtime.block_on(async move {
tokio::try_join!(
chain_source.update_fee_rate_estimates(),
chain_source.validate_zero_fee_commitments_support_if_required(
zero_fee_commitments_support_required
)
)
})?;

When concurrent requests share an Electrum client connection, a clean EOF can cause the active reader to return an error without waking other requests waiting on the connection. Those requests remain blocked in spawn_blocking, causing Tokio runtime shutdown to wait indefinitely for them to finish.

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