Skip to content
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

Fix a bug where retrying an export RQ job may break scheduling #8584

Merged
merged 1 commit into from
Oct 22, 2024

Commits on Oct 22, 2024

  1. Fix a bug where retrying an export RQ job may break scheduling

    `_patched_retry` tries to schedule a copy of the current job. In particular,
    it copies the dependencies of the old job using
    `current_rq_job.dependency_ids`.
    
    Unfortunately, `dependency_ids` does not return IDs of dependency jobs, as
    one might expect. It actually returns the Redis _keys_ corresponding to
    those jobs, as bytestrings. The RQ job creation code does not support
    bytestrings as dependency specifiers, so it unintentionally treats them as
    sequences, saving the individual bytes (as integers) as the dependency job
    IDs. But since IDs have to be strings, the scheduler quickly crashes when it
    tries to use those integer "IDs" to construct Redis keys.
    
    Thankfully, we don't actually need to get the dependency IDs.
    `_patched_retry` is only used inside running jobs, and if a job is running,
    it means that all its dependencies are already completed. Thus, the newly
    scheduled job doesn't need to have any dependencies at all.
    SpecLad committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    daf91c5 View commit details
    Browse the repository at this point in the history