Timeout problem in start up in long running tasks #2028
Unanswered
alpersergeny
asked this question in
Q&A
Replies: 1 comment 1 reply
-
i have the exact same issue, for now im gonna fork and remove the timeout altogether until it's fixed : |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Update!
Hi,
i'll try and give a little context to what we expirienced:
Setup uses Redis as Broker with streams and a task that takes longer then 3 sec to complete.
We have two Scenarios that should behave the same but they don't:
1st:
We we start the subscriber, then we a a task.
Result: Tast gets completed, faststream waits for more tasks.
2nd:
Subscriber is stopped. We add a Task, then start the Subcriber.
Result: Tasts gets completed but faststream stops with the Timeout-Error.
Reason for the timeout is in the screenshot above: the start()-function throws it, bc. it consumes a tast that takes longer then 3 seconds.
Thx for any assistance and help :)
Details :

``Hey,
I have a question about the long running tasks. Firstly I have a small environment for reproducing the issue. I am providing the code here (Code for the publisher):
Code for the sub:

Code files for the reproducing will be added here too
To reproduce the issue publisher needs to work on fastapi and sub needs to have a long running task (longer than 3.0 sec).
Steps to reproduce :
If the steps followed end result should be something like this :
As I tracked down the issue comes down to this part of the library :
A small modification to anyio.fail_after(3.0) solves the issue for the long running tasks however, I didnt understand the whole part of the project therefore not sure should I do a change on there. Thank you for all the effort and I am attaching an example case to reproduce the error. Please create the envs for it. Publisher needs
fastapi[standard]
redis
faststream[cli]
Subs:
redis
faststream[cli]
test_pub
Test_sub:
Beta Was this translation helpful? Give feedback.
All reactions