Open blackchineykh opened 4 years ago
I haven't had any issues with this library during long-running usage, and multiple queues in the same file isn't a problem either.
Is it possible that your processComment
and processMessage
methods are hanging (never returning) sometimes?
You can try logging when these methods start and when they end (at all possible exit points). The count of "method start" log messages should be equal to the count of "method end" log messages.
I am also experiencing this but I am only instantiating once. It doesn't seem like the processComment
and processMessage
(in OP's example) would cause the issue because for both of us, the issue is resolved with a restart of the instance.
Also I have logs in the start of my process functions that don't seem to ever run.
@blackchineykh did you find a solution?
@blackchineykh did you find a solution?
I never did. It doesn't seem consistent
你应该有异步的函数被挂起了,一直没有返回,导致队列没有执行 你应该检查 队列的大小 有没有变化,来判断是否 add 成功 并给每一个异步函数设置超时时间
你应该有异步的函数被挂起了,一直没有返回,导致队列没有执行 你应该检查 队列的大小 有没有变化,来判断是否 add 成功 并给每一个异步函数设置超时时间
Thanks. I'll check for that situation
Hi,
Ive been trying to use this solution in typescript and I instantiate multiple instances of the PQueue class for different job types.
After my nodejs app is run for an extended time, I notice that attempts to add to the queue do nothing.
The queues are defined within a typescript class which is then instantiated and used to call the public functions to queue the comment and message received. After long running, the processComment and processMessage methods stopped getting called.
I'm wondering if something is causing the queue to stop, or if I can declare multiple queues in the same file or doing something else wrong thats causing this issue. Note that I also subscribe to the 'active' event which logs the size and pending in the queue, which also stops logging. It just seems the add() method on the queue just doesnt work anymore unless I restart. Note that this is also being run in a docker container.
Any directions are much appreciated as I rather not try to write my own handling of this logic