You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-TasksTools for parallel and async workC-BugAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationC-TestingA change that impacts how we test Bevy or how users test their apps
I wrote the doc test thinking that it was impossible for the task that spawns another task to be inserted into the scope's task queue after the task that it spawns. That was an incorrect assumption.
pubfnspawn<Fut:Future<Output = T> + 'scope + Send>(&self,f:Fut){let task = self.executor.spawn(f);// ConcurrentQueue only errors when closed or full, but we never// close and use an unbouded queue, so it is safe to unwrapself.spawned.push(task).unwrap();}
The second task can be spawned between spawning the first task on the executor and inserting the tasks into the spawned queue.
This isn't really a problem as the docs state that a task spawned inside another task has non deterministic ordering. The fix should probably to just remove the assert and make it more clear when the results are deterministic and when it isn't.
The text was updated successfully, but these errors were encountered:
hymm
added
A-Tasks
Tools for parallel and async work
C-Docs
An addition or correction to our documentation
C-Testing
A change that impacts how we test Bevy or how users test their apps
and removed
S-Needs-Triage
This issue needs to be labelled
labels
Oct 19, 2022
# Objective
Fixesbevyengine#6306
## Solution
Change the failing assert and expand example to explain when ordering is deterministic or not.
Co-authored-by: Mike Hsu <mike.hsu@gmail.com>
# Objective
Fixesbevyengine#6306
## Solution
Change the failing assert and expand example to explain when ordering is deterministic or not.
Co-authored-by: Mike Hsu <mike.hsu@gmail.com>
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
# Objective
Fixesbevyengine#6306
## Solution
Change the failing assert and expand example to explain when ordering is deterministic or not.
Co-authored-by: Mike Hsu <mike.hsu@gmail.com>
A-TasksTools for parallel and async workC-BugAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationC-TestingA change that impacts how we test Bevy or how users test their apps
Bevy version
Test was added in #4466
What you did
Reported by targrub in discord https://discord.com/channels/691052431525675048/692572690833473578/1032353522475348018.
Test here (https://github.com/bevyengine/bevy/blob/main/crates/bevy_tasks/src/task_pool.rs#L148-L173) fails in about 1 in 20 runs of
cargo run -p bevy_tasks
What went wrong
I wrote the doc test thinking that it was impossible for the task that spawns another task to be inserted into the scope's task queue after the task that it spawns. That was an incorrect assumption.
The second task can be spawned between spawning the first task on the executor and inserting the tasks into the
spawned
queue.This isn't really a problem as the docs state that a task spawned inside another task has non deterministic ordering. The fix should probably to just remove the assert and make it more clear when the results are deterministic and when it isn't.
The text was updated successfully, but these errors were encountered: