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

I can't interrupt an expression evaluation #823

Closed
vicmosin opened this issue Apr 8, 2024 · 1 comment · Fixed by #824
Closed

I can't interrupt an expression evaluation #823

vicmosin opened this issue Apr 8, 2024 · 1 comment · Fixed by #824
Labels
scope: Camunda 7 Required in the context of Camunda 7 type: enhancement

Comments

@vicmosin
Copy link
Contributor

vicmosin commented Apr 8, 2024

Is your feature request related to a problem? Please describe.
The feel engine is currently stuck while executing long-running expressions because of the lack of "cooperation mode" (ref). It is not possible to interrupt the execution from outside the engine.

Related forum discussion: https://forum.camunda.io/t/feelengines-cooperation-mode-while-performing-longrunning-and-resource-consuming-operations/51049

We are using org.camunda.feel.FeelEngine instance to evaluate FEEL expressions and trying to find a proper way to “sandbox” this operation and give a dedicated timeout for each one, in case the user tries to execute a malicious expression.
We’ve came across the following expression as an example of such harmful snippet which can bring the instance down:

count(for x in 1..(2 ** 16) return {"power": 2 ** x}) > 0

Describe the solution you'd like
The most classical solution is to repeatedly check whether the current thread was interrupted and throw an appropriate exception

@saig0 saig0 added the scope: Camunda 7 Required in the context of Camunda 7 label Apr 10, 2024
@saig0 saig0 changed the title Cooperation mode I can't interrupt an expression evaluation Apr 10, 2024
@saig0
Copy link
Member

saig0 commented Apr 10, 2024

@vicmosin thank you for raising this. 👍 I adjusted the issue description based on the forum discussion.

I think this feature could be a small but useful improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: Camunda 7 Required in the context of Camunda 7 type: enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants