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

Review and convert long running methods to TimedCancellable #833

Open
tegefaulkes opened this issue Oct 18, 2024 · 1 comment
Open

Review and convert long running methods to TimedCancellable #833

tegefaulkes opened this issue Oct 18, 2024 · 1 comment
Labels
development Standard development

Comments

@tegefaulkes
Copy link
Contributor

Specification

With the TimedCancellable and Cancellable patterns we have a structured way of handling cancellation of long running async tasks. But we've been a bit lax applying it to the code base. Only updating code when doing refactoring or conversions. It's become evident that further review and work needs to be done to apply it to the whole code base.

So what does it need to be applied to. Well the following could take a long time to compelete.

  • A promise doing something complex or waiting for something complex to complete.
  • An AsyncGenerator returning a potentially unbounded stream of information.
  • A normal generator doing the same
  • Iterators generally but for the most part these will be bounded by memory limits so we will run into memory problems before time problems generally.

So based on this criteria we need to look through the code and apply cancelability to promises and generators. Futher more the following domains that do general background processing that needs to stop quickly need to be reviewed.

  1. Nodes domain.
  2. Tasks domain.
  3. Discovery domain.
  4. notifications domain.

Each of these maintain some degree of background state that can take time to clean up when stopping. In the worst case they will block stopping altogether if proper cancellation isn't supported.

Additional context

Tasks

  1. Review code for methods that can have proper cancellation applied to them. Emphasis on promises and generators.
  2. Review the above listed domains for general flow of cancellation since these will be the most affected by the changes.
@tegefaulkes tegefaulkes added the development Standard development label Oct 18, 2024
Copy link

linear bot commented Oct 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development
Development

No branches or pull requests

1 participant