Go to file
Alex Vandiver bc5539d871 tornado: Move SIGTERM shutdown handler into a callback.
A SIGTERM can show up at any point in the ioloop, even in places which
are not prepared to handle it.  This results in the process ignoring
the `sys.exit` which the SIGTERM handler calls, with an uncaught
SystemExit exception:

```
2021-11-09 15:37:49.368 ERR  [tornado.application:9803] Uncaught exception
Traceback (most recent call last):
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/http1connection.py", line 238, in _read_message
    delegate.finish()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/httpserver.py", line 314, in finish
    self.delegate.finish()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/routing.py", line 251, in finish
    self.delegate.finish()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/web.py", line 2097, in finish
    self.execute()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/web.py", line 2130, in execute
    **self.path_kwargs)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/gen.py", line 307, in wrapper
    yielded = next(result)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/web.py", line 1510, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zerver/tornado/handlers.py", line 150, in get
    request = self.convert_tornado_request_to_django_request()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zerver/tornado/handlers.py", line 113, in convert_tornado_request_to_django_request
    request = WSGIRequest(environ)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 66, in __init__
    script_name = get_script_name(environ)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zerver/tornado/event_queue.py", line 611, in <lambda>
    signal.signal(signal.SIGTERM, lambda signum, stack: sys.exit(1))
SystemExit: 1
```

Supervisor then terminates the process with a SIGKILL, which results
in dropping data held in the tornado process, as it does not dump its
queue.

The only command which is safe to run in the signal handler is
`ioloop.add_callback_from_signal`, which schedules the callback to run
during the course of the normal ioloop.  This callbacks does an
orderly shutdown of the server and the ioloop before exiting.
2021-11-12 09:57:23 -08:00
.github ci: Update outdated comments to generated Dockerfiles. 2021-11-05 15:45:46 -07:00
.tx cleanup: Delete trailing newlines. 2019-08-06 23:29:11 -07:00
.vscode vscode: Recommend remote development extension. 2021-11-03 16:03:46 -07:00
analytics realm: Rename plan type constants to be more descriptive. 2021-10-19 12:20:39 -07:00
confirmation migrations: Add progress output to confirmation backfill. 2021-09-17 11:23:32 -07:00
corporate corporate: Update fixtures for switching from Standard to Plus. 2021-11-05 17:23:10 -07:00
docs install: Switch default to PostgreSQL 14. 2021-11-08 18:21:46 -08:00
frontend_tests compose: Remove "Drafts" button. 2021-11-10 12:53:44 -08:00
locale i18n: Update translation data from Transifex. 2021-11-01 16:33:52 -07:00
pgroonga pgroonga: Remove unnecessary code from first migration. 2021-05-28 09:42:33 -07:00
puppet puppet: Remove an out-of-date comment. 2021-11-09 21:52:17 -08:00
requirements requirements: Upgrade Python requirements. 2021-11-02 16:30:42 -07:00
scripts install: Switch default to PostgreSQL 14. 2021-11-08 18:21:46 -08:00
static settings: Fix live `update_page` behavior for user settings. 2021-11-10 13:03:20 -08:00
stubs billing: Enforce the Stripe API version is in sync with billing system. 2021-11-05 17:23:10 -07:00
templates portico: Link back to /for/X pages from Lean case study. 2021-11-11 06:24:58 -08:00
tools dev-vagrant-docker: Upgrade docker-systemctl-replacement to 1.5.4505. 2021-11-10 09:02:56 -08:00
var/puppeteer puppeteer_tests: Port to TypeScript. 2021-02-22 16:03:10 -08:00
zerver tornado: Move SIGTERM shutdown handler into a callback. 2021-11-12 09:57:23 -08:00
zilencer zilencer: Truncate "remove" notifications from remote servers. 2021-11-10 13:39:35 -08:00
zproject saml: Add some docstrings to SAMLDocument class. 2021-11-10 12:08:56 -08:00
.browserslistrc browserslist: Drop 0.2% usage threshold to 0.15%. 2020-09-28 10:57:49 -07:00
.codecov.yml codecov: Change threshold to use percentage syntax. 2019-07-20 14:37:04 -07:00
.codespellignore CI: Add Codespell linter. 2021-10-27 16:49:30 -07:00
.editorconfig editorconfig: Restore indent_size = 2 for Markdown. 2021-08-20 23:14:37 -07:00
.eslintignore requirements: Remove Thumbor. 2021-05-06 20:07:32 -07:00
.eslintrc.json dependencies: Upgrade JavaScript dependencies. 2021-10-17 07:15:09 -07:00
.gitattributes
.gitignore editor: Add `.vscode/extensions.json` file. 2021-10-29 15:47:44 -07:00
.gitlint lint: Re-enable imperative-mood checking. 2021-02-23 14:54:07 -08:00
.mailmap mailmap: Add mailmap entry for Sahil Batra. 2021-07-21 10:46:34 -07:00
.npmignore
.prettierignore prettier: Exclude backend-processed Markdown files. 2021-08-20 23:14:37 -07:00
.pyre_configuration pysa: Update .pyre_configuration to point to typeshed. 2020-09-22 15:44:47 -07:00
.sonarcloud.properties tools: Configure Zulip to be scannable by SonarCloud. 2020-06-24 12:41:17 -07:00
.yarnrc .yarnrc: Set ignore-scripts true. 2019-08-28 16:15:54 -07:00
CODE_OF_CONDUCT.md docs: Apply bullet style changes from Prettier. 2021-09-08 12:06:24 -07:00
CONTRIBUTING.md docs: Format Markdown with Prettier. 2021-09-08 12:06:24 -07:00
Dockerfile-postgresql docs: Standardize on PostgreSQL, not Postgres. 2020-10-28 11:55:16 -07:00
LICENSE license: Move copyright notice from LICENSE to NOTICE. 2021-02-05 09:28:12 -08:00
NOTICE docs: Bump copyright year. 2021-02-05 09:28:15 -08:00
README.md docs: Apply sentence single-spacing from Prettier. 2021-09-08 12:06:24 -07:00
SECURITY.md docs: Apply sentence single-spacing from Prettier. 2021-09-08 12:06:24 -07:00
Vagrantfile Vagrantfile: Move inline provision script to a separate file. 2021-09-14 10:22:48 -07:00
babel.config.js i18n: Initialize FormatJS. 2021-04-13 17:41:10 -07:00
manage.py manage: Restore `changepassword` back to documented_commands. 2021-06-18 09:11:01 -07:00
package.json package: Upgrade tippy to fix false warnings. 2021-11-10 08:57:22 -08:00
postcss.config.js postcss: Cleanly import flatpickr dark theme. 2021-09-13 17:12:49 -07:00
prettier.config.js prettier: Disable embedded language formatting for Markdown. 2021-08-20 23:14:37 -07:00
pyproject.toml markdown: CSS-escape preview links. 2021-10-26 18:17:23 -07:00
setup.cfg pycodestyle: Improve comments documenting excludes. 2021-02-12 13:11:25 -08:00
stylelint.config.js dependencies: Upgrade JavaScript dependencies. 2021-11-05 17:34:13 -07:00
tsconfig.json tsconfig: Enable noImplicitOverride. 2021-09-13 10:10:34 -07:00
version.py package: Upgrade tippy to fix false warnings. 2021-11-10 08:57:22 -08:00
webpack.config.ts webpack: Remove LoaderOptionsPlugin. 2021-10-17 07:13:57 -07:00
yarn.lock package: Upgrade tippy to fix false warnings. 2021-11-10 08:57:22 -08:00

README.md

Zulip overview

Zulip is a powerful, open source group chat application that combines the immediacy of real-time chat with the productivity benefits of threaded conversations. Zulip is used by open source projects, Fortune 500 companies, large standards bodies, and others who need a real-time chat system that allows users to easily process hundreds or thousands of messages a day. With over 700 contributors merging over 500 commits a month, Zulip is also the largest and fastest growing open source group chat project.

GitHub Actions build status coverage status Mypy coverage code style: black code style: prettier GitHub release docs Zulip chat Twitter GitHub Sponsors

Getting started

Click on the appropriate link below. If nothing seems to apply, join us on the Zulip community server and tell us what's up!

You might be interested in:

You may also be interested in reading our blog or following us on Twitter. Zulip is distributed under the Apache 2.0 license.