Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add task::LocalSet API for running !Send futures #1733

Merged
merged 76 commits into from Nov 27, 2019
Merged

Commits on Nov 6, 2019

  1. first pass on local task set

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    7eee2ec View commit details
    Browse the repository at this point in the history
  2. it works!

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    366ecbd View commit details
    Browse the repository at this point in the history
  3. change API to work with multiple block ons

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    82857dd View commit details
    Browse the repository at this point in the history
  4. shutdown on drop

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    edd8ca4 View commit details
    Browse the repository at this point in the history
  5. use marker types to indicate whether a task is Send

    This adds a marker type to the `Task` struct and `Schedule` trait
    indicating whether or not the task is `Send`, and changes `Task` to only
    implement `Send` when the `Send` marker is present. Schedulers must
    indicate whether they are capable of scheduling `Send` or `!Send` tasks.
    
    This solution is singnificantly better than the previous one of using an
    unsafe wrapper to make `!Send` tasks implement `Send`, which was
    necessary due to the bounds on the `Task` struct. Although the previous
    solution was correct, since the `!Send` tasks were only ever scheduled
    locally, the compiler could no longer verify that this was the case.
    Now, the typesystem actually _helps_ us ensure that schedulers that can
    only schedule `Send` tasks will never schedule `!Send` tasks.
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    2e6cf55 View commit details
    Browse the repository at this point in the history
  6. add docs

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    c1e4e4a View commit details
    Browse the repository at this point in the history
  7. re-export local mod from root, feature flag

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    968eea5 View commit details
    Browse the repository at this point in the history
  8. placate clippy

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    983b6b7 View commit details
    Browse the repository at this point in the history
  9. fix doctest

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    fb99e68 View commit details
    Browse the repository at this point in the history
  10. *actually* fix doctest

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    d6ff66e View commit details
    Browse the repository at this point in the history
  11. fix wrong assertions

    These assertions asserted that the scheduler was current in all calls
    to its methods. However, the `TaskSet::spawn_local` method allows
    scheduling tasks to be run on the `TaskSet` when it is _not_ currently
    running. Therefore, these assertions are wrong.
    
    This test moves the assertion to the _right_ place: when the scheduler
    actually _runs_ scheduled tasks.
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    bc93168 View commit details
    Browse the repository at this point in the history
  12. fix missing pin-project without default features

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    17c7f7e View commit details
    Browse the repository at this point in the history
  13. fix unused code when local is disabled

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    78d41b8 View commit details
    Browse the repository at this point in the history
  14. add send markers to debug output

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    057f415 View commit details
    Browse the repository at this point in the history
  15. fdsgkhsdfhjkgljkfdg;jklagdsf

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    f00f099 View commit details
    Browse the repository at this point in the history
  16. fix more feature-flaggy sadness

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    157e2e2 View commit details
    Browse the repository at this point in the history
  17. rename marker types

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    2a88b5f View commit details
    Browse the repository at this point in the history
  18. make markers void structs

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    eef8727 View commit details
    Browse the repository at this point in the history
  19. remove duplicate file

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    1c0cea1 View commit details
    Browse the repository at this point in the history
  20. fix wrong assertions

    These assertions asserted that the scheduler was current in all calls
    to its methods. However, the `TaskSet::spawn_local` method allows
    scheduling tasks to be run on the `TaskSet` when it is _not_ currently
    running. Therefore, these assertions are wrong.
    
    This commit moves the assertion to the _right_ place: when the scheduler
    actually _runs_ scheduled tasks.
    
    I had previously made this change but I think that it was lost
    in a rebase.
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    b6243c6 View commit details
    Browse the repository at this point in the history
  21. add test that timer exists

    hawkw committed Nov 6, 2019
    Copy the full SHA
    44fb6c8 View commit details
    Browse the repository at this point in the history
  22. Copy the full SHA
    ff05221 View commit details
    Browse the repository at this point in the history
  23. fix wrong doctest

    this must've gotten lost in a rebase
    hawkw committed Nov 6, 2019
    Copy the full SHA
    45dc55a View commit details
    Browse the repository at this point in the history
  24. fix missing feature flag

    this must've also been lost in the rebase
    hawkw committed Nov 6, 2019
    Copy the full SHA
    b92ff94 View commit details
    Browse the repository at this point in the history
  25. agh, doctest

    hawkw committed Nov 6, 2019
    Copy the full SHA
    e09fb8e View commit details
    Browse the repository at this point in the history
  26. don't run local tests when running loom tests

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 6, 2019
    Copy the full SHA
    fec3b91 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2019

  1. rename TaskSet -> TaskGroup

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 7, 2019
    Copy the full SHA
    478e73f View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    da87e96 View commit details
    Browse the repository at this point in the history
  3. improve API docs

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 7, 2019
    Copy the full SHA
    267f3f3 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    c06cba8 View commit details
    Browse the repository at this point in the history
  5. track timer being renamed to time (#1745)

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 7, 2019
    Copy the full SHA
    99e05b2 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2019

  1. Merge branch 'master' into eliza/local-spawn

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    44ad494 View commit details
    Browse the repository at this point in the history
  2. move local out of runtime and into task

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    1b9b25c View commit details
    Browse the repository at this point in the history
  3. rename to spawn_local

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    b8488c7 View commit details
    Browse the repository at this point in the history
  4. rename TaskGroup -> LocalSet

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    07317af View commit details
    Browse the repository at this point in the history
  5. remove root reexport

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    6f7607e View commit details
    Browse the repository at this point in the history
  6. remove from runtime

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    2246de2 View commit details
    Browse the repository at this point in the history
  7. doctest fixup

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    c4f6034 View commit details
    Browse the repository at this point in the history
  8. simplify Send marker

    Thanks to @carllerche for the suggestion; this makes the diff much
    smaller!
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    f4d8b5a View commit details
    Browse the repository at this point in the history
  9. fix tests using the wrong blocking

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    8f21118 View commit details
    Browse the repository at this point in the history
  10. naming + internal docs improvement

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    cbc1a42 View commit details
    Browse the repository at this point in the history
  11. set thread local in block_on

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    72472ca View commit details
    Browse the repository at this point in the history
  12. fix local future spinning instead of parking

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    927ae9b View commit details
    Browse the repository at this point in the history
  13. local scheduler doesn't need to be Send + Sync

    it *shouldn't* be, because it's just a pile of UnsafeCells...
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    34e3428 View commit details
    Browse the repository at this point in the history
  14. add tests for waking a local set from IO

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    0fbe6ab View commit details
    Browse the repository at this point in the history
  15. use the rt's waker in block_on

    this fixes the local set not being woken by IO on the current-thread rt
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    1ad14c7 View commit details
    Browse the repository at this point in the history
  16. rm phantomdata

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    ab19812 View commit details
    Browse the repository at this point in the history
  17. fix local queue being pushed to from remote

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    1007cad View commit details
    Browse the repository at this point in the history
  18. remove "local" feature

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    5265b41 View commit details
    Browse the repository at this point in the history
  19. add additional assertions

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    c42992b View commit details
    Browse the repository at this point in the history
  20. use AtomicWaker instead of mutex

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    0514a56 View commit details
    Browse the repository at this point in the history
  21. avoid double panics

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    c7b0cb7 View commit details
    Browse the repository at this point in the history
  22. fix warnings

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    36efbb4 View commit details
    Browse the repository at this point in the history
  23. rustfmt

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    25d9bf4 View commit details
    Browse the repository at this point in the history
  24. placate clippy

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    26994c9 View commit details
    Browse the repository at this point in the history
  25. maybe they were supposed to be underscores???

    i just copied the clippy error message...
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    20ccb39 View commit details
    Browse the repository at this point in the history
  26. undo unrelated naming change

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 13, 2019
    Copy the full SHA
    f28ded7 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2019

  1. review feedback

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 14, 2019
    Copy the full SHA
    ef29af8 View commit details
    Browse the repository at this point in the history
  2. put clippy attribute in the right place

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 14, 2019
    Copy the full SHA
    7a9c84e View commit details
    Browse the repository at this point in the history
  3. fix unused code based on feature flags

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 14, 2019
    Copy the full SHA
    f1211e3 View commit details
    Browse the repository at this point in the history
  4. review feedback: rename ScheduleSend -> ScheduleSendOnly

    thanks @jonhoo!
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 14, 2019
    Copy the full SHA
    6ff8c4f View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2019

  1. Merge master + update some things

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 18, 2019
    Copy the full SHA
    b21cca7 View commit details
    Browse the repository at this point in the history
  2. Avoid starving the remote queue

    Copied from `basic_scheduler`
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 18, 2019
    Copy the full SHA
    17d520a View commit details
    Browse the repository at this point in the history
  3. allow tasks to be cancelled remotely

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 18, 2019
    Copy the full SHA
    cfa2808 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    6f43e7e View commit details
    Browse the repository at this point in the history
  5. fix accidental hang in test

    hawkw committed Nov 18, 2019
    Copy the full SHA
    f1c82c5 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    b919c95 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2019

  1. fix yielding

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 21, 2019
    Copy the full SHA
    fe93b45 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2019

  1. Merge branch 'master' into eliza/local-spawn

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 26, 2019
    Copy the full SHA
    66f4a45 View commit details
    Browse the repository at this point in the history
  2. fix bad merge

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 26, 2019
    Copy the full SHA
    40374f7 View commit details
    Browse the repository at this point in the history
  3. fix bad merge 2: the fixening

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 26, 2019
    Copy the full SHA
    7260998 View commit details
    Browse the repository at this point in the history
  4. more cleanup

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 26, 2019
    Copy the full SHA
    e40faca View commit details
    Browse the repository at this point in the history
  5. rm empty file committed accidentally

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 26, 2019
    Copy the full SHA
    9c805b6 View commit details
    Browse the repository at this point in the history
  6. move to rt-util feature

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 26, 2019
    Copy the full SHA
    04b0189 View commit details
    Browse the repository at this point in the history
  7. panic if nested

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 26, 2019
    Copy the full SHA
    0528537 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2019

  1. fix AtomicWaker being enabled when not used

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Nov 27, 2019
    Copy the full SHA
    3418bfb View commit details
    Browse the repository at this point in the history