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

Return 503 if the event transfer job isn't keeping up with logged events #72

Open
petli opened this issue Oct 7, 2014 · 0 comments
Open

Comments

@petli
Copy link
Member

petli commented Oct 7, 2014

command.execute/logEvent should check if the event transfer job is keeping up, and if not throw an exception that results in the frontend returning a 503 to the client.

An assumption has to be made by the event rate, and then ensure that say 10 minutes of events fit in the capped collection for temporary event storage in core.

This can then be a fairly simple implementation:

  • logEvent need to keep track of the timestamp of the last event logged in the capped collection
  • If it checked on the event transfer with the last N minutes (e.g. 2), it will just log the event
  • If it has been more than N minutes, it checks the timestamp of the last event in the long-term event collection
    • If that timestamp is > M minutes older (e.g. 5 minutes) than the previously logged event, it rejects the command to return a 503.
      • It remembers this status for K minutes (e.g. 1) and rejects all commands during this period, before checking next if the log transfer is again healthy.
    • Otherwise all is good for another N minutes
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

1 participant