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

Clear scroll if not used anymore #2271

Merged
merged 2 commits into from
Jun 3, 2019
Merged

Clear scroll if not used anymore #2271

merged 2 commits into from
Jun 3, 2019

Conversation

agix
Copy link

@agix agix commented Jun 3, 2019

Following this commit elastic/elasticsearch@d27aa72 in elasticsearch. A scroll parallel limit of 500 is set.

This seems related to this issue : #2249

Elastalert create scroll for each research with default to 30s for keeping the scroll context alive.

But it never clears the scroll if it's not used anymore

As it's really easy to open 500 scroll in 30 seconds, the scroll should be clear after usage.

@@ -624,7 +625,8 @@ def run_query(self, rule, start=None, end=None, scroll=False):
pass

if 'scroll_id' in rule:
rule.pop('scroll_id')
scroll_id = rule.pop('scroll_id')
self.current_es.clear_scroll(scroll_id=scroll_id)

Choose a reason for hiding this comment

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

@Qmando For clearing the es scroll, we have to send the scroll id in the body, i applied below change and my scroll is maintained at the max limit i set.
self.thread_data.current_es.clear_scroll(body={'scroll_id': scroll_id})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants