zulip/zerver/management/commands
Alex Vandiver e1acd7b974 process_queue: For threaded workers, create them when they start.
Creating the QueueProcessingWorker objects when the ThreadedWorker is
created can lead to a race which caused confusing error messages:

1. A thread tries to call `self.worker = get_worker()`
2. This call raises an exception, which is caught by
   `log_and_exit_if_exception`
3. `log_and_exit_if_exception` sends our process a SIGUSR1, _but
    otherwise swallows the error_.
4. The thread's `.run()` is called, which tries to access
   `self.worker`, which was never set, and throws another exception.
5. The process handles the SIGUSR1, restarting.

Move the creation of the worker to when it is started, so the worker
object does not need to be stored, and possibly have a decoupled
failure.
2024-01-12 08:38:46 -08:00
..
__init__.py
add_users_to_streams.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
archive_messages.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
audit_fts_indexes.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
backup.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
bulk_change_user_name.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
change_password.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
change_realm_subdomain.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
change_user_email.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
change_user_role.py change_user_role: List role choices in --help output. 2023-12-14 15:06:18 -08:00
check_redis.py models: Extract zerver.models.users. 2023-12-16 22:08:44 -08:00
checkconfig.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
compilemessages.py compilemessages: Normalize language names to NFC. 2023-10-26 16:27:35 -07:00
convert_gitter_data.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
convert_mattermost_data.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
convert_rocketchat_data.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
convert_slack_data.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
create_default_stream_groups.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
create_realm.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
create_realm_internal_bots.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
create_stream.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
create_user.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
deactivate_realm.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
deactivate_user.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
delete_old_unclaimed_attachments.py models: Move some functions to zerver.lib.attachments. 2023-12-16 22:08:44 -08:00
delete_realm.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
delete_user.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
deliver_scheduled_emails.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
deliver_scheduled_messages.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
edit_linkifiers.py models: Extract zerver.models.linkifiers. 2023-12-16 22:08:44 -08:00
email_mirror.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
enqueue_digest_emails.py python: Consistently use from…import for datetime. 2023-12-05 12:01:18 -08:00
enqueue_file.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
export.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
export_search.py models: Extract zerver.models.users. 2023-12-16 22:08:44 -08:00
export_single_user.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
export_usermessage_batch.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
fetch_tor_exit_nodes.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
fill_memcached_caches.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
generate_realm_creation_link.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
get_migration_status.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
import.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
list_realms.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
logout_all_users.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
makemessages.py requirements: Upgrade Python requirements. 2023-12-07 14:41:01 -08:00
merge_streams.py models: Extract zerver.models.streams. 2023-12-16 22:08:44 -08:00
process_queue.py process_queue: For threaded workers, create them when they start. 2024-01-12 08:38:46 -08:00
promote_new_full_members.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
purge_queue.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
query_ldap.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
rate_limit.py models: Extract zerver.models.users. 2023-12-16 22:08:44 -08:00
reactivate_realm.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
realm_domain.py models: Extract zerver.models.realms. 2023-12-16 22:08:44 -08:00
register_server.py management: Provide a way to deactivate the push registration. 2024-01-04 15:34:28 -08:00
remove_users_from_stream.py models: Extract zerver.models.streams. 2023-12-16 22:08:44 -08:00
reset_authentication_attempt_count.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
restore_messages.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
runtornado.py tornado: Fix autoreload for Tornado 6.4 changes. 2023-12-09 14:24:45 -08:00
scrub_realm.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
send_custom_email.py send_email: Distinct emails means distinct, case-insensitively. 2024-01-04 10:46:53 -08:00
send_password_reset_email.py send_password_reset_email: Add a flag to only email users who need it. 2024-01-07 16:43:31 -08:00
send_realm_reactivation_email.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
send_test_email.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
send_to_email_mirror.py models: Extract zerver.models.streams. 2023-12-16 22:08:44 -08:00
send_webhook_fixture_message.py models: Extract zerver.models.realms. 2023-12-16 22:08:44 -08:00
send_welcome_bot_message.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
show_admins.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
soft_deactivate_users.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
sync_ldap_user_data.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
transfer_uploads_to_s3.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
unarchive_stream.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00