Skip to content
This repository was archived by the owner on Nov 1, 2026. It is now read-only.
This repository was archived by the owner on Nov 1, 2026. It is now read-only.

Get Sequences by Id raises RecursionError when a download takes longer than about 10 seconds #18

Open

Description

@dpc00

Claude reports: Get Sequences by Id fails with RecursionError when any download takes longer than about 10 seconds (a busy NCBI, many ids, a slow connection).

Cause: handle_threads (lines 129-147) polls by calling itself (return handle_threads(next_threads, results), line 144) once per pass, sleeping 0.01 s per running thread, so about 1000 passes (about 10 s) reach Python's recursion limit.

Observed: Entrez.efetch replaced by a fake that sleeps 14 s for id SLOW (no other change). sublime-mcp's hang report showed the nested handle_threads frames while Sublime was busy, and after about 10 s the console shows RecursionError: maximum recursion depth exceeded (traceback repeated 989 times from BioPythonUtils.py line 133/144). The same function run on its own fails after 10.6 s. The window is unusable for those seconds because the wait runs on the main thread (see #5), and nothing is written.

Fix: replace the recursion with a loop (while threads: ...), or thread.join() each thread in order, which also fixes the result order (see the separate issue about order).

Tested on Sublime Text build 4215 (portable, Windows), plugin host Python 3.14, installed through Package Control (BioPythonUtils 2017.12.18.15.00.45, which contains the fixes for #3). Line numbers are those of BioPythonUtils.py on master (de058c4).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions