Skip to content

Conversation

@everaldorodrigo
Copy link
Contributor

No description provided.

@everaldorodrigo everaldorodrigo changed the base branch from master to 1.1.x October 10, 2025 23:54
@everaldorodrigo everaldorodrigo marked this pull request as ready for review October 10, 2025 23:57
await self.client.clear_scroll(scroll_id=query.data)
logger.info("Scroll context cleared: %s", scroll_id)
except Exception as e:
logger.warning("Failed to clear scroll context (ID: %s): %s", scroll_id, str(e))
Copy link
Contributor

Choose a reason for hiding this comment

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

What's an example where we wouldn't be able to clear the scroll context? Would it be a networking issue or like if something interrupted the context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that could be errors. It could also happen if the context was already cleaned up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When it tries to clear a non-existent scroll_id, it returns a NotFoundError 404.

raise RawResultInterrupt(res)

if not res["hits"]["hits"]:
scroll_id = str(query.data) if query.data else "None"
Copy link
Member

Choose a reason for hiding this comment

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

do we need this here? if isinstance(query, ESScrollID) is True, is there a case query.data is not a scroll_id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, we don't need this here.

if not res["hits"]["hits"]:
scroll_id = str(query.data) if query.data else "None"
try:
await self.client.clear_scroll(scroll_id=query.data)
Copy link
Member

Choose a reason for hiding this comment

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

if you already have a scroll_id variable before this line, should we just pass scroll_id here?

@everaldorodrigo everaldorodrigo merged commit e9a47d0 into 1.1.x Oct 28, 2025
6 of 7 checks passed
@everaldorodrigo everaldorodrigo deleted the clear-scroll-id-context branch October 28, 2025 19:10
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.

4 participants