eclipse-score / eclipse-score/kyron

Bug: JoinHandle can be moved to different task causing using wrong waker

Open
#39 1 comment 0 reactions 1 assignee Claimed by @prabakaranklst View on GitHub
bug
Dominant language
Rust
Stars
2
Forks
12
Avg merge
21h 55m
Merged PRs (30d)
4

Description

Currently, we set the waker only on the first run of JoinHandle Future. Since it is `Unpin`, it can be moved to a different task, leaving an old waker which will cause a wakeup of the wrong task once the child task is done.

Please:
- Create a test case that reproduces that
- once confirmed, fix implementation alogin with #32

Consider the above and #32
- JoinHandle shall always set the waker on its poll
- The TLS Context for the worker shall always keep a handle to the currently running task set by the worker
- JoinHandle shall check if the connected task is safety, if yes, then it shall use `current task` safety instead of the one in `poll` as `ctx` - this can cause some pesimizations in waking, but this seems to be the only way to ensure that a task that is starting a safety task can be woken into safety worker.

Please consider the above idea and develop alternative or improved proposals.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.