Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Query buffering fixes #673

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Conversation

Sushisource
Copy link
Member

What was changed

Made buffered queries be appropriately handled before a new "real" WFT if one is received while still handling an outstanding one.

Why?

The previous implementation banked on failing the tasks with the now "stale" queries if a new "real" WFT is received while they are buffered causing server to retry them while the client is still waiting on the query response. For whatever reason this doesn't always work. Instead, the implementation will now try to handle all buffered queries before applying the next real WFT. This potentially slows things down in very high-query-load scenarios, but that's more-or-less what Go and Java do and no one complains. Users shouldn't spam queries that hard anyway.

Checklist

  1. Closes [Bug] Queries may still sometimes be dropped when buffering tasks #672

  2. How was this tested:

  1. Any docs updates needed?

@Sushisource Sushisource requested a review from a team as a code owner January 19, 2024 18:49
} else {
if self.wft.is_some() {
self.query_only_tasks_for_buffered.clear();
}
let _ = self.wft.insert(task);
Copy link
Contributor

@dandavison dandavison Jan 19, 2024

Choose a reason for hiding this comment

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

Why is this OK -- couldn't self.wft have events and updates that we must process?

Copy link
Member Author

Choose a reason for hiding this comment

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

By definition it is stale and invalid now if there's a new incoming WFT

Copy link
Contributor

@dandavison dandavison left a comment

Choose a reason for hiding this comment

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

LGTM!

@Sushisource Sushisource merged commit cb08b1b into temporalio:master Jan 19, 2024
7 checks passed
@Sushisource Sushisource deleted the query-buffering-bug branch January 19, 2024 22:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Queries may still sometimes be dropped when buffering tasks
2 participants