8000 frontend: Incorrect use of block_on() on plan_fragmenter · Issue #7439 · risingwavelabs/risingwave · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
frontend: Incorrect use of block_on() on plan_fragmenter  #7439
Closed
@ZENOTME

Description

@ZENOTME

Describe the bug

In plan_fragmenter, for getting the source information(it's a async interface), we use block_on.

let mut enumerator = block_on(SplitEnumeratorImpl::create(property))?;

But that block_on will cause the woker in runtime blocked. In deterministic simulation, the runtime seems only run in a single thread, so that will cause whole program be blocked. For the block reason, we can refer:
tokio-rs/tokio-compat#23 (comment)

Solution:

  1. change BatchPlanFragmenter.split into a async. These solution seems impossible, because PlanRef is hard to satisfy Send,Sync trait. (BatchPlanFragmenter.split need to statisfy thread safety if we change it to a async function). Lots of thing need to modify if we take it...
  2. delay get source information util we schedule the fragment. (The schedule work is async so we can directly use the async operation in it)
    local_execute(session.clone(), query, query_snapshot).await?,

    This solution seems also impossible. We need the source information to get the parallelism, parallelism needed for creating fragment.
    let child_exchange_info = node.distribution().to_prost(builder.parallelism, self);
  3. I think it's a available solution. Including split information in SourceCatalog. And that we don't need async operation to get source information(including parallelism)
    For the timestamp limit, we can delay it util we schedule the fragment.
    kafka_enumerator.list_splits_batch(timestamp_bound.0, timestamp_bound.1),

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

type/bugType: Bug. Only for issues.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0