upstash / qstash-js

Message queue for serverless
https://docs.upstash.com/qstash
MIT License
133 stars 11 forks source link

How do you tackle context deadline exceeded issue if your process is a bit lengthy? #76

Closed muhammad-jawad-92 closed 4 months ago

muhammad-jawad-92 commented 4 months ago

I talked with Qstash support and they said they cancel the request if the response isn't received in 2 minutes, and in result we get a "context deadline exceeded" error.

Currently our architecture is very straight forward. We send a job request to Qstash, and qstash does the job behind the scenes. I have seen that when we send more than 100 jobs to qstash ( I mean in a large volume), then I get to see this error. Is it maybe because the API which we hit through Qstash is not resilient enough? Any leads appreciated!

sancar commented 4 months ago

It could be the reason, yes. I would first check the Qstash Logs. Together with the exception context deadline exceeded there should be a timestamp as well.

Screenshot 2024-02-26 at 13 09 43

You can see the start time from ACTIVE log and the time you get context deadline.. from ERROR state. If the difference is same as our timeouts in pricing, (free 2 minutes/pay as you go 5 minutes), then everything is running correctly in Qstash side. You should check the API you are hitting through Qstash to see how it behaves under the load.

If the timeouts and logs does not match, we should investigate the issue more on our side.

muhammad-jawad-92 commented 4 months ago

Hi, so the issue is closable, thanks to you.

I realized that the timeouts are same as mentioned in the plan. So, everything's running correctly in Qstash side.