-
Notifications
You must be signed in to change notification settings - Fork 287
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
Fatal Python error: Cannot recover from stack overflow. #493
Comments
I'm not familiar with python, so please let me know. What kind of code should I fix? |
I'll start by saying that I'm not particularly familiar with the code either. At a high level I can see that the function run_query is recursive. While I don't know why the original author chose that, it generally seems like a bad idea. Rewriting it to be iterative instead of recursive seems like an improvement. I'd welcome comments from anyone more familiar with elastalert. |
Two fix pull requests have been merged in 2016 and 2019. It was the time of the original yelp / elastalert, and I don't know the details, but it seems that the problem often occurred. 2016
|
I found an unmerged pull request on the original yelp / elastalert in 2019. refactor run_query |
At a glance, that refactoring is about the right shape. It is of course done on an older version and would need to be merged forward and tested. Nice find. |
What do you think about this issue? .. Reason for question I'm not using elastalert2, I'm just checking the operation to see if the changes work correctly only when I make a pull request. .. So I don't know if this is a frequent issue or if it needs to be addressed urgently. |
I've not seen this error myself, but it is something that should be corrected. Python's stack limit is 1000 stack frames so it you have enough search results to an ElastAlert query then it is technically possible to hit this bug, depending on the scroll size. There are multiple options, in order of complexity:
#1 would be very simple to implement and update the docs. |
It happens here:
This seems like whomever coded this was aware that this could happen, but i don't believe any kind of exception handling can deal with a stack overflow.
I don't have a reproduction unfortunately. This has happened once on an otherwise static setup. Of note is that my elastic instance can be quite slow at times.
The text was updated successfully, but these errors were encountered: