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

StackOverflowError when a SearchParseException is thrown #11994

Closed
colings86 opened this issue Jul 2, 2015 · 2 comments
Closed

StackOverflowError when a SearchParseException is thrown #11994

colings86 opened this issue Jul 2, 2015 · 2 comments
Assignees
Labels

Comments

@colings86
Copy link
Contributor

The following request produces a SearchParseException because there is no aggregator of type foo:

GET _search
{
  "aggs": {
    "foo": {
      "bar": {}
    }
  }
}

On the current master this is masked by a StackOverflowError (I presume as the stack trace fall off the top of the console buffer) will the follow (part) stacktrace showing the infinite loop:

    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:277)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:312)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:277)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:312)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:277)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:312)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:277)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:312)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:277)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:312)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:277)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:312)
    at org.elasticsearch.ElasticsearchException.toXContent(ElasticsearchException.java:277)
@colings86
Copy link
Contributor Author

SearchParseException extends SearchException which in turn extends ElasticsearchException and implements ElasticsearchWrapperException. Any exception which extends ElasticsearchException and implements ElasticsearchWrapperExceptionwill suffer this issue

@colings86
Copy link
Contributor Author

From what I can see, the following Exceptions are affected:

  • BroadcastShardOperationFailedException
  • IndexCreationException
  • PercolateException
  • RecoverFilesRecoveryException
  • RemoteTransportException
  • SearchException
  • SearchContextException
  • SendRequestTransportException

@colings86 colings86 self-assigned this Jul 3, 2015
@s1monw s1monw assigned s1monw and unassigned colings86 Jul 3, 2015
s1monw added a commit to s1monw/elasticsearch that referenced this issue Jul 3, 2015
the specialization can cause stack overflows if an exception is a
ElasticsearchWrapperException as well as a ElasticsearchException.
This commit just relies on the unwrap logic now to find the cause and only
renders if we the rendering exception is the cause otherwise forwards
to the generic exception rendering.

Closes elastic#11994
@lcawl lcawl added :Core/Infra/Core Core issues without another label and removed :Exceptions labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants