Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gateway sporadically stops sending notifications #17

Open
bloudermilk opened this issue Aug 8, 2014 · 3 comments
Open

Gateway sporadically stops sending notifications #17

bloudermilk opened this issue Aug 8, 2014 · 3 comments

Comments

@bloudermilk
Copy link

It seems there's another bug after fixing #14 and #15 which is causing our agent to stop processing its queue.

Order of events:

  1. 18:23:22 - Last notification sent
  2. Queue begins piling up
  3. 18:24:16 - Cache cleaned out (30s TTL)
  4. 18:26:00 - Invalid token error received
  5. 18:26:03 - Gateway successfully reconnects
  6. Queue continues piling up. No more notifications have been sent since event 1 above.

I don't have any ideas as to why this is happening yet. Let me know if I can provide any more info that might be helpful.

@logicalparadox
Copy link
Owner

It seems like a race condition is putting the queue back into a pause state immediately after it has been resumed. I would start by checking to see if the _queueIterator is even being invoked after .resume()

At a lower level, the queue might decide to not process the next item if any of these conditions pass: https://github.com/qualiancy/breeze-queue/blob/master/lib/queue.js#L200-L203

I'll see what else I can find....

@logicalparadox
Copy link
Owner

Theory: when the last item is sent I don't see a "cache push" notification for id 434787 which would occur here. Coincidentally, that is when next would be called, thus reducing the worker count for the queue. Then, once resume is called it the queue thinks all the workers are still busy so it never invokes the queue iterator for the next item in the queue.

@vseryakov
Copy link

Hi, i am seeing similar behaviour, i send lots of events one by one but sometimes it works but sometimes only one or two got delivered and the rest just gone. Is there a simple way to push the queue, like forcing to call process every once in a while with a timeout?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants