Scripting: Cache script results if deterministic#50106
Scripting: Cache script results if deterministic#50106stu-elastic merged 49 commits intoelastic:masterfrom
Conversation
…e/painless-caching-part-2
…e/painless-caching-part-2
|
Pinging @elastic/es-core-infra (:Core/Infra/Scripting) |
jdconrad
left a comment
There was a problem hiding this comment.
LGTM once we address the couple of comments I left that require further discussion.
.../spi/src/main/java/org/elasticsearch/painless/spi/annotation/NonDeterministicAnnotation.java
Show resolved
Hide resolved
modules/lang-painless/src/main/resources/org/elasticsearch/painless/spi/java.util.txt
Show resolved
Hide resolved
rjernst
left a comment
There was a problem hiding this comment.
LGTM. Left a few suggestions.
.../spi/src/main/java/org/elasticsearch/painless/spi/annotation/NonDeterministicAnnotation.java
Show resolved
Hide resolved
...rc/main/java/org/elasticsearch/painless/spi/annotation/NonDeterministicAnnotationParser.java
Show resolved
Hide resolved
modules/lang-painless/src/main/java/org/elasticsearch/painless/ScriptRoot.java
Outdated
Show resolved
Hide resolved
|
Currently debugging NPE when using scripts for weighted avg, fieldName coming in as null. |
|
Ok, now that scripts are cachable, here's what's causing the NPE
calls into
which calls which eventually calls
which nulls out because there is no Here's the series of calls to reproduce: |
|
This just happened to be caught by a test. Are there other places where |
|
@elasticmachine run elasticsearch-ci/1 |
|
@stu-elastic Thanks again for all the work getting this done. The tests look especially good. |
Cache results from queries that use scripts if they use only deterministic API calls. Nondeterministic API calls are marked in the whitelist with the `@nondeterministic` annotation. Examples are `Math.random()` and `new Date()`. Refs: elastic#49466
Cache results from queries that use scripts if they use only deterministic API calls. Nondeterministic API calls are marked in the whitelist with the `@nondeterministic` annotation. Examples are `Math.random()` and `new Date()`. Refs: #49466
Cache results from queries that use scripts if they use only deterministic API calls. Nondeterministic API calls are marked in the whitelist with the `@nondeterministic` annotation. Examples are `Math.random()` and `new Date()`. Refs: elastic#49466
Cache results from queries that use scripts if they use only
deterministic API calls. Nondeterministic API calls are marked in the
whitelist with the
@nondeterministicannotation. Examples areMath.random()andnew Date().Refs: #49466