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?
Asked
Active
Viewed 250 times
2 Answers
0
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.

Long Quanzheng
- 2,076
- 1
- 10
- 22
-
Ok, I am using a context with a timeout of 60 seconds so I believe timeout is not an issue in this case – Vardan Saakian Oct 08 '20 at 20:00
-
It's working for me. I just updated my answer with an example to try it in CLI. Can you also try that? I guess somewhere wrong in your code about timeout. – Long Quanzheng Oct 08 '20 at 21:47
-
I will double check and get back to you – Vardan Saakian Oct 09 '20 at 06:57
-
It seems like a workflow get stucked in `DecisionTaskScheduled` state. Could it be due to communication problem with Cadence server? – Vardan Saakian Oct 09 '20 at 09:40
-
Answered it. Thank you for your help anyway! One mystery less in this Cadence Leviathan :D – Vardan Saakian Oct 09 '20 at 10:48
-
Yeah, congrat! That’s a common mistake using Cadence. BTW I think my answer is still most relevant to your question:D if you think so please accept it . – Long Quanzheng Oct 10 '20 at 16:04
0
Oh, I figured out what it was - my tasklist
was not configured properly. So it was the reason workflow is stuck in DecisionTaskScheduled
state

Vardan Saakian
- 49
- 1
- 7