Skip to content

Fix asyncPush bounded buffer termination#6439

Draft
coyaSONG wants to merge 1 commit into
Effect-TS:v3from
coyaSONG:agent/fix-async-push-bounded-termination
Draft

Fix asyncPush bounded buffer termination#6439
coyaSONG wants to merge 1 commit into
Effect-TS:v3from
coyaSONG:agent/fix-async-push-bounded-termination

Conversation

@coyaSONG

Copy link
Copy Markdown
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Stream.asyncPush can synchronously offer both a buffered element and a termination signal before the stream starts consuming the queue. With a bounded dropping or sliding queue sized exactly to the configured buffer, the termination signal can be lost and the stream waits indefinitely.

This change reserves one additional queue slot for termination, and adds regression coverage for both bounded strategies. The effect package also receives a patch changeset.

Validation:

  • pnpm test packages/effect/test/Stream/async.test.ts (22 tests passed)
  • pnpm lint-fix
  • pnpm check
  • pnpm build
  • pnpm docgen
  • git diff --check

Codex was used to investigate, implement, and validate this change. The exact validation commands and results are listed above.

Related

@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jul 16, 2026
@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8aae878

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
effect Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

switch (options?.strategy) {
case "sliding":
return Queue.sliding(options.bufferSize ?? 16)
return Queue.sliding((options.bufferSize ?? 16) + 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this just delays the problem rather than fixing it

@IMax153 IMax153 added the 3.0 Used for issues, pull requests, etc. that are relevant for the `v3` branch targeting Effect v3. label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0 Used for issues, pull requests, etc. that are relevant for the `v3` branch targeting Effect v3.

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

3 participants