There were a couple of errors with the way the maximum event size was being limited that this fixes: * Only the maximum batch size was being accounted for, not the maximum size of an individual event (which is 20% of the batch limit). * When truncation was done, we were adding an is_truncated field to the event, but the truncation didn't account for the size of this new field. This commit fixes these issues and moves the truncation-handling into a new wrapper class called PublishableEvent, instead of doing it inside the queue-processor itself. It also takes advantage of the application_headers support on amqp messages to send info about which field is truncatable separate from the actual event data. This lets us avoid needing to deserialize the JSON unless truncation is actually necessary (and supported). Graphite events are also added so that we can more easily track how often oversize events need to be truncated or dropped.
Greetings!
This is the primary codebase that powers reddit.com.
For notices about major changes and general discussion of reddit development, subscribe to the /r/redditdev and /r/changelog subreddits.
You can also chat with us via IRC in #reddit-dev on freenode.
Quickstart
To set up your own instance of reddit to develop with, we have a handy install script for Ubuntu that will automatically install and configure most of the stack.
Alternatively, refer to our Install Guide for instructions on setting up reddit from scratch. Many frequently asked questions regarding local reddit installs are covered in our FAQ.
APIs
To learn more about reddit's API, check out our automated API documentation and the API wiki page. Please use a unique User-Agent string and take care to abide by our API rules.
Happy hacking!
Issues and Contribution Guidelines
Thanks for wanting to help make reddit better! First things first, though: github issues is only for confirmed, active bugs. Please submit ideas to /r/ideasfortheadmins.
Please read more on contributions in CONTRIBUTING.md.