opensafely-core / opensafely-core/opencodelists

Bug report: Cloning large codelists fails

Open
#2,969 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug deck-scrubbing
Dominant language
Python
Stars
60
Forks
16
Avg merge
4d 12h
Merged PRs (30d)
17

Description

Summary

Cloning large and/or complex CodelistVersions fails

What did you do and what did you expect to happen?

  • Opened https://www.opencodelists.org/codelist/opensafely/migration-status/4095ab22/

  • Clicked "Clone this codelist"

  • Expected a clone of this codelist to appear in the list of my codelists

  • After a long delay an internal server error was returned

  • Running locally with a recent database backup, the process does complete but takes ~180s

  • This is a large codelist (~7500 codes) with many very broad and overlapping searches and thus many inclusion/exclusion decisions associated with it

Impact of the bug

User reported on Slack
Can workaround for now.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the clone from the migration-status codelist URL, using a recent database backup locally, and inspect the linked Sentry error for the failing request. Trace the clone operation for large, complex CodelistVersions with many searches and inclusion/exclusion decisions. Done means the reported codelist clones successfully without an internal server error and without the roughly 180-second delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.