zulip/zerver
Alex Vandiver 75f1070881 queue_processors: Disable timeouts with PushNotificationsWorker.
Since 3853285241, PushNotificationsWorker uses the aioapns library
to send Apple push notifications.  This introduces an asyncio event
loop into this worker process, which, if unlucky, can respond poorly
when a SIGALRM is introduced to it:

```
[asyncio] Task exception was never retrieved
future: <Task finished coro=<send_apple_push_notification.<locals>.attempt_send() done, defined at /path/to/zerver/lib/push_notifications.py:166> exception=WorkerTimeoutException(30, 1)>
Traceback (most recent call last):
  File "/path/to/zerver/lib/push_notifications.py", line 169, in attempt_send
    result = await apns_context.apns.send_notification(request)
  File "/path/to/zulip-py3-venv/lib/python3.6/site-packages/aioapns/client.py", line 57, in send_notification
    response = await self.pool.send_notification(request)
  File "/path/to/zulip-py3-venv/lib/python3.6/site-packages/aioapns/connection.py", line 407, in send_notification
    response = await connection.send_notification(request)
  File "/path/to/zulip-py3-venv/lib/python3.6/site-packages/aioapns/connection.py", line 189, in send_notification
    data = json.dumps(request.message, ensure_ascii=False).encode()
  File "/usr/lib/python3.6/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/lib/python3.6/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.6/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/path/to/zerver/worker/queue_processors.py", line 353, in timer_expired
    raise WorkerTimeoutException(limit, len(events))
zerver.worker.queue_processors.WorkerTimeoutException: Timed out after 30 seconds processing 1 events
```

...which subsequently leads to the worker failing to make any progress
on the queue.

Remove the timeout on the worker.  This may result in failing to make
forward progress if Apple/Google take overly long handling requests,
but is likely preferable to failing to make forward progress if _one_
request takes too long and gets unlucky with when the signal comes
through.
2021-10-21 08:59:56 -07:00
..
data_import slack import: Fix requests.get usage of get_slack_api_data. 2021-10-07 11:46:23 -07:00
integration_fixtures/nagios tests: Add a test for fixtures for non-webhook integrations. 2021-04-28 08:16:51 -07:00
lib push_notifications: Fix RemoteZulipServer annotation to work at runtime. 2021-10-20 00:48:55 -07:00
management realm: Rename plan type constants to be more descriptive. 2021-10-19 12:20:39 -07:00
migrations auth: Add support for using SCIM for account management. 2021-10-14 12:29:10 -07:00
openapi lint: Fix typos found by codespell. 2021-10-19 16:51:13 -07:00
tests push_notifications: Pass down the remote server and user-id for logs. 2021-10-19 22:04:24 -07:00
tornado lint: Fix typos found by codespell. 2021-10-19 16:51:13 -07:00
views realm: Rename plan type constants to be more descriptive. 2021-10-19 12:20:39 -07:00
webhooks help: Add newline after admonition header for Prettier compatibility. 2021-09-10 10:39:25 -07:00
worker queue_processors: Disable timeouts with PushNotificationsWorker. 2021-10-21 08:59:56 -07:00
__init__.py django: Upgrade Zulip to Django 3.2 LTS. 2021-05-03 08:36:22 -07:00
apps.py caching: Make sender type optional for flush_cache. 2021-07-26 14:48:07 -07:00
context_processors.py auth: Add login buttons for web public access. 2021-10-05 16:30:40 -07:00
decorator.py push_notifications: Provide a hint when the server is not registered. 2021-10-19 12:17:30 -07:00
filters.py typing: Fix function signatures. 2021-08-20 05:54:19 -07:00
forms.py auth: Make the deactivated user error message clearer. 2021-09-10 10:47:15 -07:00
logging_handlers.py logging_handlers: Remove STAGING_ERROR_NOTIFICATIONS setting. 2021-07-07 09:26:02 -07:00
middleware.py lint: Fix typos found by codespell. 2021-10-19 16:51:13 -07:00
models.py typo: Fix duplicated word in comment. 2021-10-20 12:53:50 -07:00
signals.py python: Convert deprecated Django ugettext alias to gettext. 2021-04-15 18:01:34 -07:00