I get the aforementioned error when trying to start a workflow (and query it for init). It took me a while to get into names of things - after reading this it is more clear what decision task really is, however I think I am still a bit lost in terminology. So I believe in my case decision task takes longer than 1 sec (queryFirstDecisionTaskWaitTime). Is this wait time in any way configurable? Has anyone experienced similar issue?

2

There are 2 answers

6
Long Quanzheng On BEST ANSWER

Yes, you should be able to "configure" the queryFirstDecisionTaskWaitTime by setting request timeout.

For example, in golang that's just the context timeout when sending the query requests to Cadence server.

Tested in CLI:

% date ; ~/cadence/cadence --ct 10 --do qlong wf query -w helloworld_b721724d-11f9-4b5b-a158-2bda4a230297 --query_type "__stack_trace" ; date
Thu Oct  8 14:46:47 PDT 2020
Error: Query workflow failed.
Error Details: QueryFailedError{Message: workflow must handle at least one decision task before it can be queried}
('export CADENCE_CLI_SHOW_STACKS=1' to see stack traces)
Thu Oct  8 14:46:56 PDT 2020

Note: --ct 10 means we uses 10 seconds as context timeout for this command.

As a minimum, defaultQueryFirstDecisionTaskWaitTime is one second. Currently there is no way to change this minimum boundary. And I don't think we need that as you can configure per each request :D

BTW, thank you for asking questions in StackOverfolw, that helps us to preserve knowledge for the community better.

0
Vardan Saakian On

Oh, I figured out what it was - my tasklist was not configured properly. So it was the reason workflow is stuck in DecisionTaskScheduled state