[ejabberd] [progress report] google:queue implementation in ejabberd

David Laban alsuren at gmail.com
Mon Mar 4 18:20:32 MSK 2013

I have made a little progress:

* I decided that the rumoured <sleep xmlns="
http://www.facebook.com/xmpp/suspend"/> extension,
  as it is a better fit for the iOS battery-killer restriction
(google:queue is too easy to DoS).

* I have implemented an ejabberd_suspend SockMod that can wrap
ejabberd_socket (or any other socket type that implement the same
  * Currently:
    * <sleep/> causes your current c2s #state{sockmod, socket} to be
wrapped in ejabberd_suspend.
    * <flush/> causes ejabberd_suspend to push all queued packets out.
    * <wake/> causes your #state{sockmod, socket} to be unwrapped (I think
I might be leaking processes
      here though. Still need to check)
* https://github.com/alsuren/ejabberd_tests/commits/p1-google-queue-wip and
  https://github.com/alsuren/ejabberd/commits/google-queue-wip are the
appropriate branches.
  * Note that google-queue-wip has been heavily rebased to make it easier
to review.
  * google-queue-raw documents my progress in order, for posterity.

  * Implement a pause= attribute like
    and allow its default/maximum allowed values to be set in ejabberd.cfg.
  * Work out how to hibernate as many processes as possible when I know
that we are going to be
    asleep for a long period of time.

* Questions:
  * Do my patches look like they are in vaguely the right shape (ignoring
my buildsystem changes, obviously)
  * Any general comments about style and correctness would be much

On Fri, Feb 22, 2013 at 8:30 AM, Mickaël Rémond <mremond at process-one.net>wrote:

> Hello David,
> Thank you for sharing, I will have a look.
> --
> Mickaël Rémond
> On Thu, Feb 21, 2013 at 6:25 PM, David Laban <alsuren at gmail.com> wrote:
>> I'm in the process of implementing google:queue [1] in ejabberd.
>> https://github.com/alsuren/ejabberd_tests/commits/p1-google-queue-wip contains
>> some minimal tests (note that it is a work-in-progress branch, so expect its history to be re-written before I submit any merge requests).
>> If anyone has any pointers about where I should be inserting the s2c queue management logic, feel free to shout.
>> Work on my ejabberd implementation will go on
>> https://github.com/alsuren/ejabberd/commits/google-queue-wip, which is
>> based on https://github.com/processone/ejabberd/commits/2.1.x
>> If anyone has any hints about smoothing the process of
>> getting my patches accepted (do I need to provide
>> test cases in quick-check form or anything?) then please also shout.
>> David.
>> [1]
>> https://github.com/alsuren/ejabberd_tests/blob/p1-google-queue-wip/doc/google-queue.xmlcourtesy of Dave Cridland
>> _______________________________________________
>> ejabberd mailing list
>> ejabberd at jabber.ru
>> http://lists.jabber.ru/mailman/listinfo/ejabberd
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20130304/54decf5b/attachment.html>

More information about the ejabberd mailing list