zulip/zilencer/management/commands
Alex Vandiver d47637fa40 queue: Set a max consume timeout with SIGALRM.
SIGALRM is the simplest way to set a specific maximum duration that
queue workers can take to handle a specific message.  This only works
in non-threaded environments, however, as signal handlers are
per-process, not per-thread.

The MAX_CONSUME_SECONDS is set quite high, at 10s -- the longest
average worker consume time is embed_links, which hovers near 1s.
Since just knowing the recent mean does not give much information[1],
it is difficult to know how much variance is expected.  As such, we
set the threshold to be such that only events which are significant
outliers will be timed out.  This can be tuned downwards as more
statistics are gathered on the runtime of the workers.

The exception to this is DeferredWorker, which deals with quite-long
requests, and thus has no enforceable SLO.

[1] https://www.autodesk.com/research/publications/same-stats-different-graphs
2020-10-06 17:26:14 -07:00
..
__init__.py
add_mock_conversation.py database: Remove short_name from UserProfile. 2020-07-17 11:15:15 -07:00
add_new_realm.py database: Remove short_name from UserProfile. 2020-07-17 11:15:15 -07:00
add_new_user.py database: Remove short_name from UserProfile. 2020-07-17 11:15:15 -07:00
add_remote_server.py python: Sort migrations/management command imports with isort. 2020-01-14 13:07:47 -08:00
calculate_first_visible_message_id.py python: Remove redundant dest for argparse arguments. 2020-09-02 11:04:10 -07:00
compare_messages.py python: Convert "".format to Python 3.6 f-strings. 2020-06-08 15:31:20 -07:00
invoice_plans.py python: Sort migrations/management command imports with isort. 2020-01-14 13:07:47 -08:00
mark_all_messages_unread.py mark_all_messages_unread: Remove reset of depricated pointer. 2020-07-06 15:47:27 -07:00
migrate_stream_notifications.py python: Sort migrations/management command imports with isort. 2020-01-14 13:07:47 -08:00
populate_db.py populate_db: Set wildcard_mention_policy to show warning in test_suite. 2020-10-01 12:20:41 -07:00
print_initial_password.py python: Elide type=str from argparse arguments. 2020-09-03 16:17:14 -07:00
profile_request.py python: Elide type=str from argparse arguments. 2020-09-03 16:17:14 -07:00
queue_rate.py queue: Set a max consume timeout with SIGALRM. 2020-10-06 17:26:14 -07:00
render_messages.py python: Replace ujson with orjson. 2020-08-11 10:55:12 -07:00
sync_api_key.py python: Convert percent formatting to Python 3.6 f-strings. 2020-06-10 15:02:09 -07:00