temporalio / sdk-core

Core Temporal SDK that can be used as a base for language specific Temporal SDKs
MIT License
266 stars 70 forks source link

Query buffering fixes #673

Closed Sushisource closed 7 months ago

Sushisource commented 7 months ago

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 https://github.com/temporalio/sdk-core/issues/672

  2. How was this tested:

  3. Any docs updates needed?