Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Reset UAID when too many messages are stored #473

Closed
bbangert opened this issue May 18, 2016 · 5 comments · Fixed by #728
Closed

Reset UAID when too many messages are stored #473

bbangert opened this issue May 18, 2016 · 5 comments · Fixed by #728

Comments

@bbangert
Copy link
Member

bbangert commented May 18, 2016

We currently have no limits on max messages. However, if a developer accidentally sends a huge amount, they'll end up hitting our quota and be silently unsubscribed. We should be more lenient in these cases and try to accomdate accidents by resetting the UAID on connect if there's too_many_stored_messages, so that the registration handlers registered may trigger.

@bbangert bbangert added this to the PUSHSVC-0: quality milestone May 18, 2016
@bbangert
Copy link
Member Author

@martinthomson thoughts? Other PS's do something similar allowing clients to recover and re-sync state in the event an app-server messes up. At the moment we have no limits, so if someone makes a thousand pop-ups..... heh.

@martinthomson
Copy link

So you are talking about dropping the subscription when this happens, right? On reconnect, the client will then fail and that leads to a new subscription, which seems fine to me.

@bbangert
Copy link
Member Author

Yes, it'll in effect drop all subscriptions (we have no efficient way to count messages per subscription, just over all stored). So the client can resubscribe then.

@bbangert bbangert added p2 and removed p3 labels Aug 19, 2016
@bbangert bbangert self-assigned this Aug 31, 2016
@bbangert bbangert removed their assignment Sep 12, 2016
@bbangert
Copy link
Member Author

#643 will alleviate this issue greatly as messages can be replaced instead of just expired. So I'm upping its priority and implementing it first.

For this ticket, I believe the best path is:

  • Record the calculated TTL expire time as well as the message time + TTL value
  • Upon client connect, connection node will count stored messages, if they exceed a stored threshold value, shift into a 'reset mode'
  • In 'reset mode' query only for messages with a non-expired TTL, deliver up to N of them, delete the users router record, disconnect the client
  • Client reconnects and re-subscribes

This alleviates the delete 'write' overhead by letting table rotation delete all the stored messages.

@jrconlin jrconlin self-assigned this Oct 5, 2016
@bbangert bbangert added p1 and removed p2 labels Oct 7, 2016
@jrconlin
Copy link
Member

There's a limit on the number of channelIDs that we can store for a given UAID. We'll also need to communicate this to the client when we fail to assign a new channelID. (Otherwise we could go into a death spiral as a new UAID is assigned, and the client again tries to add too many active channels to the given UAID.)

@jrconlin jrconlin self-assigned this Nov 8, 2016
@jrconlin jrconlin added in progress and removed ready labels Nov 8, 2016
jrconlin added a commit that referenced this issue Nov 8, 2016
jrconlin added a commit that referenced this issue Nov 8, 2016
jrconlin added a commit that referenced this issue Nov 8, 2016
jrconlin added a commit that referenced this issue Nov 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants