-
Notifications
You must be signed in to change notification settings - Fork 25.2k
5.0: pipeline painless script error doesn't fail fast #21842
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
Comments
Is there any good way to evaluate a script for syntax errors when adding a pipeline? |
You are using an inline script. Instead, store the script, then reference it by id. See https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting-using.html#modules-scripting-stored-scripts |
I really don't think that should matter, when a pipeline is created any script should at least be checked to ensure it can be compiled. On a side note any reason for not using an inline script (besides it could be evicted from memory) |
I agree. |
@talevy could you take a look at this when you have time please? |
sure. This does seem to be an oversight on our part for sure. The ScriptProcessor leverages the ScriptService's caching strategies to keep around a compiled version of each script passed in. The reason we chose not to compile the script up-front is due to any changes that may occur with respect to stored scripts, or file-based scripts. Didn't want the pipeline to have to listen to such changes. Since inline scripts are not subject to such management, should be straightforward to treat inline scripts separately and compile it ourselves. |
I'm in the process of converting a groovy script to painless (previously run as a transform). One thing I noticed was that even through the script was incorrect it was accepted. Part of the mantra for 5.x is fail fast so as to give you a good dev experience.
I don't see a failure until I try to ingest data.
With the error
The text was updated successfully, but these errors were encountered: