Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

A first yield that is not a task leaks the generator

オープン
#19 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, rust
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
JavaScript
スター
36
フォーク
20
平均マージ
20時間 52分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/duroxide-node のほかの issue

microsoft/duroxide-node の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。