Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Exceptions raised in `Spawn`ed cothread can be lost

Open
#40 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start at the Spawn and Wait entry points described in the issue and reproduce the provided task example without calling Wait(). Trace how the exception is stored and reported, including the suggested del path; done means an exception from a completed spawned cothread is reported even when Wait() is never called.

Written by the indexing model from the issue text.

Description

cannot fix

The Spawn option raise_on_wait causes reporting of any exception terminating the spawned cothread to be deferred until .Wait() is called on the associated cothread, for instance:

def task(): raise Exception('Die')
def test():
    action = Spawn(task, raise_on_wait = True)
    action.Wait()

Unfortunately if .Wait() is never called then the associated exception is never reported.

It might be possible to fix this by added a __del__ method to Spawn and reporting any exception that hasn't already been reported.

Dominant language
C
Stars
13
Forks
11
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from DiamondLightSource/cothread

All issues in DiamondLightSource/cothread

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.