Skip to content

Conversation

@markstory
Copy link
Member

Change the default of taskworker.enabled to true which will enable taskworkers for self-hosted as well.

Refs STREAM-450

Change the default of `taskworker.enabled` to true which will enable
taskworkers for self-hosted as well.

Refs STREAM-450
@markstory markstory requested a review from a team September 12, 2025 14:40
@linear
Copy link

linear bot commented Sep 12, 2025

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 12, 2025
Comment on lines +3343 to 3344
default=True,
flags=FLAG_AUTOMATOR_MODIFIABLE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential bug: Changing the default of taskworker.enabled to True will break self-hosted deployments, which lack the required Kafka infrastructure and will fail to process background tasks.
  • Description: Changing the default for taskworker.enabled to True routes background tasks to the taskworker system. This system relies on Kafka, as shown by topic definitions in src/sentry/conf/types/kafka_definition.py and producer logic in src/sentry/taskworker/registry.py. Self-hosted deployments are configured with Redis/RabbitMQ for Celery and do not have Kafka infrastructure. The change lacks a corresponding override in self-hosted/sentry.conf.py to keep taskworkers disabled. As a result, self-hosted instances will attempt to send tasks to non-existent Kafka brokers, causing background job processing to fail and breaking core Sentry functionality.

  • Suggested fix: Add SENTRY_OPTIONS["taskworker.enabled"] = False to self-hosted/sentry.conf.py. This will maintain the existing Celery-based task processing for self-hosted instances and prevent breakages until they are prepared to migrate to the new taskworker system.
    severity: 0.92, confidence: 0.98

Did we get this right? 👍 / 👎 to inform future reviews.

markstory added a commit to getsentry/self-hosted that referenced this pull request Sep 12, 2025
Along with getsentry/sentry#99374 and this change taskworkers will be
enabled by default in self-hosted. I've left the celery workers active
to smooth over any tasks that are in-flight during an upgrade.

Add a worker healtcheck as we have one now.

Refs STREAM-450
@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #99374      +/-   ##
==========================================
- Coverage   81.24%   81.19%   -0.05%     
==========================================
  Files        8589     8591       +2     
  Lines      380056   380353     +297     
  Branches    24128    24128              
==========================================
+ Hits       308760   308831      +71     
- Misses      70943    71169     +226     
  Partials      353      353              

@patch("django.utils.timezone.now")
def test_basic_update(self, mock_timezone_now: MagicMock) -> None:
@freeze_time("2023-10-03 00:00:00")
def test_basic_update(self) -> None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests were also duplicated in tests/sentry/api/endpoints/test_project_codeowners_details.py. It looks like the old test module was left behind during #97916

aldy505 pushed a commit to getsentry/self-hosted that referenced this pull request Sep 13, 2025
…heck (#3933)

feat(tasks) Remove taskworker option override and add worker healthcheck

Along with getsentry/sentry#99374 and this change taskworkers will be
enabled by default in self-hosted. I've left the celery workers active
to smooth over any tasks that are in-flight during an upgrade.

Add a worker healtcheck as we have one now.

Refs STREAM-450
@markstory markstory merged commit 3d0e504 into master Sep 15, 2025
64 checks passed
@markstory markstory deleted the feat-taskworker-default branch September 15, 2025 15:34
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants