Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

A first yield that is not a task leaks the generator

Offen
#19 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
65/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
javascript, rust
Bereich
backend

Rechercherichtung

Start at lib/duroxide.js:61, where JS stores the generator before the first step, and trace driveStep's handling of the yielded value. Then read src/handlers.rs, the parse in call_create_blocking (301-312) and the dispose guard (801-812) that only fires once set_gen_id was called. Reproduce with an orchestration whose first yield is yield 42; done means the orchestration fails as it does now but disposeGenerator runs and the map entry is gone.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

Summary

If the first value that an orchestration yields is not a valid task, the generator object stays in the generators map for the life of the process.

Where

How it fails

  1. The orchestration yields something that is not a task as its first step. Examples are yield 42 and a Promise yielded by mistake.
  2. JS returns { status: 'yielded', generatorId, task: 42 }.
  3. Rust fails with Invalid generator step result: ... and the orchestration fails. This part is right.
  4. guard.set_gen_id was never called, so disposeGenerator is never called. The generator, its closure and its context stay in the map.

A bad value in a later step is handled: by then the guard knows the ID.

How this was checked

Read in the code. The Python SDK has the same code path, and a run there shows the leak: microsoft/duroxide-python#19.

Suggested fix

Either of these:

  • In driveStep, check that the yielded value is a task. If it is not, delete the generator and return an error.
  • In Rust, read generatorId from the raw JSON before the task is parsed, and dispose the generator on a parse error.

Tracked in microsoft/duroxide#55.

Vorherrschende Sprache
JavaScript
Sterne
36
Forks
20
Ø Merge
20 Std. 52 Min.
Gemergte PRs (30 T.)
4

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/duroxide-node

Alle Issues in microsoft/duroxide-node

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.