hey guys, I'm using cf queue, but I'm

hey guys, I'm using cf queue, but I'm experiencing some delay to delivery the message, after publishing the message in the queue, the worker starts to process it after +30s. Do you have any idea about it?
15 Replies
0xthierry
0xthierryOP4mo ago
I'm running a cf worker that is used as an API and also worker processing messages from this queue. Everything is running in the JS environment and the framework used is the HonoJS.
elithrar
elithrar4mo ago
What is your consumer configuration? Can you share the config here as-is? e.g. did you configure a batch timeout of 30s?
0xthierry
0xthierryOP4mo ago
No description
0xthierry
0xthierryOP4mo ago
I didn't found this batch timeout config @elithrar @Pranshu Maheshwari the queue id = 6fcbbbd468a5459e81a29a8bb56bb577 and account id = 9161f3bf7875fc457efb6c4fc392e289 anyone could help me?
Pranshu Maheshwari
Hey! just checked, could you confirm for me if you're still sending data to this queue? I see only a small amount of activity here, from yesterday and a small amount of activity a month ago, ~and everything looks normal from our side in the logs / metrics~ (Edit: it does actually look like it's taking 30s for messages to get picked up) Could you share your consumer worker code with me, along with the wrangler.toml you're using for your consumer? feel free to dm me if you'd prefer
0xthierry
0xthierryOP4mo ago
I'm sending in your DM
ManaGeorge
ManaGeorge4mo ago
I’m experiencing a similar issue - queue consumer seems to get stuck and waits for cpu timeout before moving to the next message. I’ve experienced it on three queues consumers, but I was able to roll back one to a version from a week ago and I’m not experiencing the issue there. Haven’t changed my wrangler.toml, batch config, or core of my queue handler in that time. Did either of you find a solution here? @0xthierry @Pranshu Maheshwari
Pranshu Maheshwari
Could you share a few things with me: - queue ID & account ID - your consumer code feel free to DM me if you'd prefer waiting for cpu timeouts is most likely a different issue than the one from the top of this thread
ManaGeorge
ManaGeorge4mo ago
Sent you a DM! Thanks in advance for any help
luiseok
luiseok4mo ago
Hi @Pranshu Maheshwari , I'm also having the similar issue (Stuck in the queue; producing message works, but consuming doesn't). I can provide information via DM, so could you check it for me just this once, too?
Pranshu Maheshwari
yes please 🙂
ManaGeorge
ManaGeorge4mo ago
Update for anyone else experiencing this: current conclusion (from Pranshu) is that this appears to be a bug on cloudflare's end, some people have reported disconnecting/reconnecting the consumer works, for me the disconnect/reconnect results in the first message going through followed by the same 30s delay for the second message (no change in behavior, I think the 30s delay relates to the consumer finishing/releasing the message incorrectly but can't verify). I also tried making a new queue and connecting my producer/consumer to that queue, no change. Tried deploying my consumer code using older versions of wrangler (from before I was experiencing the issue), no change. The only thing that's worked for me is rolling back my consumer code to a deployment before I experienced the issue (first deployment of live with bug 8/12, previous [no bug] deployment was 8/5). Not sure why this works for me (can't find a way to see what cloudflare is using as the deployed consumer code vs the current deployment's code), but it does.
elithrar
elithrar4mo ago
Tried deploying my consumer code using older versions of wrangler (from before I was experiencing the issue), no change
Wrangler is just a client, so it won't change anything. The client code it bundles isn't the issue here.
Pranshu Maheshwari
for folks on this thread: we've identified the issue causing 30s delays in @luiseok's account. we're rolling out a fix this week. still working on the issues for other accounts!
ManaGeorge
ManaGeorge3mo ago
Was still experiencing the delay this morning, did more testing on my code, was able to re-deploy old code without the delay. I'm confident the hang is caused by my code but not sure why it's happening (I know the code that's causing it but not why that code causes it). I've been able to intentionally cause delays within my code execution by calling the bugged function, which makes me think this isn't a queues issue. Maybe a workers issue but more likely a gap in my JS/TS knowledge. The interesting thing (and what led me to thinking it was a queues issue in the first place) was that the hang happens after the function successfully executes (including the updated/changed code). Fixed it, silly bug in my code. Anyways, thanks to anyone who looked into this!
Want results from more Discord servers?
Add your server