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

Engine limiters and checking task cancellation #262

Open
milseman opened this issue Apr 10, 2022 · 0 comments
Open

Engine limiters and checking task cancellation #262

milseman opened this issue Apr 10, 2022 · 0 comments
Milestone

Comments

@milseman
Copy link
Collaborator

During proposal reviews, concerns of RDoS and responsivity came up. We should add engine limiters which can halt execution if some threshold is exceeded, either counted in time or number of byte code instructions (possibly proportional to input length). Additionally, we should check Task.checkCancellation() in case the parent task has been cancelled.

  • Basic limiter infrastructure based on engine cycle count
  • Occasionally (say every thousand bytecode instructions executed) check cancellation
  • Testing infrastructure around limiters
  • Limiters based on input length
  • Surface as API

From https://forums.swift.org/t/se-0350-regex-type-and-overview/56530/19:

In the meantime, before that is available, would it be possible to include some calls to Task.checkCancellation() during the evaluation of the match? The use case I'm thinking of for this for evaluating a user-specified Regex in an interactive application. If the match operation is taking too long, it should be possible for the user to cancel this.

@milseman milseman added this to the Future milestone Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant