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.
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
Closes https://github.com/temporalio/sdk-core/issues/672
How was this tested:
Any docs updates needed?