zulip/zerver/tornado
Tim Abbott 2aab71e153 event_queue: Fix confusing event_queue.push interface.
In e3ad9baf1d, we introduced yet another
bug where we incorrectly shared event dictionaries between multiple
queues.

Fortunately, the logging that reports on "event was not in the queue"
issues worked and detected this on chat.zulip.org, but this is a clear
indication that the comments we have around this system were not
sufficient to produce correct behavior.

We fix this by changing event_queue.push, the code that mutates the
event dictionaries, to do the shallow copies itself.  The only
downside here is process_message_event, a relatively low-traffic code
path, does an extra per-queue dictionary copy.  Given that presence,
heartbeat, and message reading events are likely more traffic and
dealing with HTTP is likely much more expensive than a dictionary
copy, this probably doesn't matter performance-wise.

(And if profiling later finds it is, there are potential workarounds
like passing a skip_copy argument we can do).
2020-02-05 12:40:01 -08:00
..
__init__.py
application.py dependencies: Remove WebSockets system for sending messages. 2020-01-14 22:34:00 -08:00
autoreload.py tornado: Fix bugs in Tornado autoreload library. 2019-08-02 12:47:49 -07:00
descriptors.py typing: Use TYPE_CHECKING when dealing with cyclic dependencies. 2019-07-31 12:19:39 -07:00
event_queue.py event_queue: Fix confusing event_queue.push interface. 2020-02-05 12:40:01 -08:00
exceptions.py cleanup: Delete leading newlines. 2019-08-06 23:29:11 -07:00
handlers.py mypy: Upgrade from 0.730 to 0.740. 2019-11-13 12:38:45 -08:00
ioloop_logging.py mypy: Fix missing type annotation in tornado code. 2018-11-20 19:08:14 -08:00
sharding.py dependencies: Remove WebSockets system for sending messages. 2020-01-14 22:34:00 -08:00
views.py presence: Add slim_presence flag. 2020-02-04 12:30:34 -08:00