Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • E emper
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • i4i4
  • manycore
  • emper
  • Merge requests
  • !297

properly cancel future callbacks

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Florian Fischer requested to merge aj46ezos/emper:fix-future-callback-cancellation into master Dec 22, 2021
  • Overview 0
  • Commits 2
  • Pipelines 4
  • Changes 6

Currently canceling Futures would never happen because we issued the cancel request only with the pointer of the future. This works more by coincidence than by design because the PointerTags::Future tagged onto the submitted future pointer is 0.

This does not work for callbacks because they are tagged with a PointerTags != 0 and they don't use their callback pointer rather than the future pointer.

Fix this by exporting the tagging from IoContext::prepareFutureChain into IoContext::createFutureTag and use this when submitting a cancel sqe.

Warn the user that they have to manually take care of the memory safety of the callback because we can not await the callback in Future::cancel.

Add a test case to CancelFutureTest.

Edited Dec 25, 2021 by Florian Fischer
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix-future-callback-cancellation