Skip to content

Split fast path ignores receiver’s scheduler leading to mismatched completion thread #6905

@shlokjain2031

Description

@shlokjain2031

Problem
When split replays a cached result on the fast path (predecessor_done == true), it calls set_value inline on the thread that calls add_continuation(). This ignores the receiver’s completion scheduler returned by get_completion_scheduler<set_value_t>(get_env(receiver)).

There is a TODO in split.hpp#L349 around the fast-path that mentions preserving the scheduler, but the current implementation does not propagate it.

Observed behavior from a demo file

shlokjain@Shloks-MacBook-Pro-2 hpx %  /Users/shlokjain/hpx/split_fastpath_scheduler_violation_demo
=== split fast-path scheduler mismatch (HPX split only) ===

Predecessor completed on thread 0x1eecea0c0 with value=42

UI scheduler thread id : 0x16d3cb000
Main thread id          : 0x1eecea0c0

Connecting split sender from MAIN thread to a receiver that expects the UI scheduler...

set_value called with value=42
  expected scheduler(UI) thread id: 0x16d3cb000
  actual completion thread id     : 0x1eecea0c0
  match? NO

Demo finished.

Reproduce
Minimal standalone demo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions