Skip to content

fix: implement create_user_task workaround #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

asajjad2
Copy link
Contributor

What are the relevant tickets?

#6807

Description (What does it do?)

This PR implements a workaround for an issue in the django-user-tasks library where the create_user_task signal handler fails with TypeError('tuple indices must be integers or slices, not str') when processing Celery tasks with protocol version 2 (the default in recent Celery versions). This occurs when processing our task_upload_course_s3 task.

The django-user-tasks library was designed for Celery's protocol version 1, but our application uses protocol version 2. This causes errors in logs when tasks are published, though the tasks themselves still execute.

Changes:

  • Disconnect the original signal handler
  • Connect a wrapper function that detects the protocol version
  • For protocol v2 messages, convert them to protocol v1 format before passing to the original handler
  • For protocol v1 messages, pass them through unchanged

@pdpinch
Copy link
Member

pdpinch commented Mar 28, 2025

Since this is a bugfix, I think we should open an upstream PR in edx-platform instead of creating a new plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants