Skip to content

Conversation

@jdconrad
Copy link
Contributor

@jdconrad jdconrad commented May 6, 2019

This change adds imported methods, class bindings, and instance bindings to the documentation generation for the Painless Context APIs.

@jdconrad jdconrad added >enhancement >docs General docs changes :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache v8.0.0 v7.2.0 labels May 6, 2019
@jdconrad jdconrad requested a review from rjernst May 6, 2019 21:34
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@jdconrad
Copy link
Contributor Author

jdconrad commented May 7, 2019

@elasticmachine run elasticsearch-ci/1

jaymode and others added 7 commits May 7, 2019 10:24
* Update TLS ciphers and protocols for JDK 11 (elastic#41385)

This commit updates the default ciphers and TLS protocols that are used
after the minimum supported JDK is JDK 11. The conditionals around
TLSv1.3 and 256-bit cipher support have been removed. JDK 11 no longer
requires an unlimited JCE policy file for 256 bit cipher support and
TLSv1.3 is supported in JDK 11+. New cipher support has been introduced
in the newer JDK versions as well. The ciphers are ordered with PFS
ciphers being most preferred, then AEAD ciphers, and finally those with
mainstream hardware support.

* Fixes for TLSv1.3 on JDK11

* fix for JDK-8212885
…tic#41893)

The class was called PatternSeenEventExcpectation. This commit
is a straight class rename to correct the spelling.
Today if an exception is thrown when serializing a cluster state during
publication then the master enters a poisoned state where it cannot publish any
more cluster states, but nor does it stand down as master, yielding repeated
exceptions of the following form:

```
failed to commit cluster state version [12345]
org.elasticsearch.cluster.coordination.FailedToCommitClusterStateException: publishing failed
        at org.elasticsearch.cluster.coordination.Coordinator.publish(Coordinator.java:1045) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.cluster.service.MasterService.publish(MasterService.java:252) [elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:238) [elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:142) [elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:681) [elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252) [elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215) [elasticsearch-7.0.0.jar:7.0.0]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
Caused by: org.elasticsearch.cluster.coordination.CoordinationStateRejectedException: cannot start publishing next value before accepting previous one
        at org.elasticsearch.cluster.coordination.CoordinationState.handleClientValue(CoordinationState.java:280) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.cluster.coordination.Coordinator.publish(Coordinator.java:1030) ~[elasticsearch-7.0.0.jar:7.0.0]
        ... 11 more
```

This is because it already created the publication request using
`CoordinationState#handleClientValue()` but then it fails before accepting it.
This commit addresses this by performing the serialization before calling
`handleClientValue()`.

Relates elastic#41090, which was the source of such a serialization exception.
The CircuitBreaker was introduced as means of preventing a
`StackOverflowException` during the build of the AST by the parser.

The ANTLR4 grammar causes a weird behaviour for a Parser Listener.
The `enterEveryRule()` method is often called with a different parsing
context than the respective `exitEveryRule()`. This makes it difficult
to keep track of the tree's depth, and a custom Map was used as an
attempt of matching the contextes as they are encounter during `enter`
and during `exit` of the rules.

This approach had 2 important drawbacks:
1. It's hard to maintain this custom Map as the grammar changes.
2. The CircuitBreaker could often lead to false positives which caused
valid queries to return an Exception and prevent them from executing.

So, this removes completely the CircuitBreaker which is replaced be
a simple handling of the `StackOverflowException`

Fixes: elastic#41471
@jdconrad
Copy link
Contributor Author

jdconrad commented May 7, 2019

@elasticmachine run elasticsearch-ci/1

* Allow unknown task time in QueueResizingEsTPE

The afterExecute method previously asserted that a TimedRunnable task
must have a positive execution time. However, the code in TimedRunnable
returns a value of -1 when a task time is unknown. Here, we expand the
logic in the assertion to allow for that possibility, and we don't
update our task time average if the value is negative.

Fixes elastic#41448

* Add a failure flag to TimedRunnable

In order to be sure that a task has an execution time of -1 because of
a failure, I'm adding a failure flag boolean to the TimedRunnable class.
If execution time is negative for some other reason, an assertion will
fail.
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one suggestion


for (PainlessContextInfo contextInfo : contextInfos) {
for (PainlessContextMethodInfo methodInfo : contextInfo.getImportedMethods()) {
staticInfoCounts.compute(methodInfo, (k, v) -> v == null ? 1 : v + 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be done more simply with merge:

staticInfoCounts.merge(methodInfo, 1, Integer::sum)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed.

rjernst and others added 2 commits May 7, 2019 14:40
This commit removes versioned logic in analyzer creation that is no
longer relevant for 8.0.
@jdconrad
Copy link
Contributor Author

jdconrad commented May 7, 2019

@rjernst Thank you for the review. Will commit as soon as CI completes.

jdconrad and others added 3 commits May 7, 2019 15:07
This commit removes some ml-cpp binary files that were commited to the
repository.
@jdconrad
Copy link
Contributor Author

jdconrad commented May 8, 2019

@elasticmachine run elasticsearch-ci/2

@jdconrad jdconrad merged commit 6bf8b19 into elastic:master May 8, 2019
jdconrad added a commit that referenced this pull request May 8, 2019
This change adds imported methods, class bindings, and instance bindings to the documentation generation for the Painless Context APIs.
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request May 9, 2019
…rsing

* elastic/master:
  [ML] relax set upgrade mode test to match what is guaranteed (elastic#41958)
  Add note about ILM action ordering (elastic#41771)
  Remove Version 6 pre-release constants (elastic#41517)
  Mute illegal interval rollup tests
  Add static section whitelist info to api docs generation (elastic#41870)
  Cleanup RollupSearch exceptions, disallow partial results (elastic#41272)
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
This change adds imported methods, class bindings, and instance bindings to the documentation generation for the Painless Context APIs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >docs General docs changes >enhancement v7.2.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.