I sometimes get messages out of order even if they are sorted within a batch. This seems to be because the last message of the previous batch is later than the first message of the next batch.
I solved this by just ignoring the error as it's better for me to have the message dropped than logging crashing.
But I'm thinking about how to fix this. Perhaps keep a rolling buffer and only send half of it each time, so that new entries have a chance of being "sorted in"?
My patch is at norpan@0570780