[PR #1384] [CLOSED] fix(langgraph): dedupe signal listeners #1418

Closed
opened 2026-02-15 20:15:42 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1384
Author: @hntrl
Created: 7/14/2025
Status: Closed

Base: mainHead: hunter/dedupe-signal-listeners


📝 Commits (5)

  • d4db9a4 fix(langgraph): dedupe signal listeners
  • 0b3dfb1 chore(langgraph): simplify MultiAbortSignal interface
  • c55a146 chore: remove multi class artifact
  • cb67241 chore(langgraph): remove package format
  • 5ed4008 add changeset

📊 Changes

2 files changed (+74 additions, -18 deletions)

View changed files

.changeset/eleven-cheetahs-grin.md (+5 -0)
📝 libs/langgraph/src/pregel/utils/index.ts (+69 -18)

📄 Description

Currently, our approach to combining event listeners has a tendency to emit an annoying 'potential memory leak' error on some versions of node. This is because we add an event listener to the abort signal (whether passed in from options or from the default AbortController that gets created) on every runner tick, which as graphs get over a certain complexity we create more than 10 event listeners on a single signal which triggers the warning.

This fixes that by using a hierarchical MultiAbortSignal class in place of combineAbortSignals which dedupes listeners by ensuring that any signals passed in the constructor arent already tracked by a downstream abort signal.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraphjs/pull/1384 **Author:** [@hntrl](https://github.com/hntrl) **Created:** 7/14/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `hunter/dedupe-signal-listeners` --- ### 📝 Commits (5) - [`d4db9a4`](https://github.com/langchain-ai/langgraphjs/commit/d4db9a4cfbd6ac1bff1ce48cb1fa6eb17c6acc32) fix(langgraph): dedupe signal listeners - [`0b3dfb1`](https://github.com/langchain-ai/langgraphjs/commit/0b3dfb163fa8af14d42e0d0a6b88cf735e2c720e) chore(langgraph): simplify MultiAbortSignal interface - [`c55a146`](https://github.com/langchain-ai/langgraphjs/commit/c55a1465113c2066e8de0911a789023434acf900) chore: remove multi class artifact - [`cb67241`](https://github.com/langchain-ai/langgraphjs/commit/cb67241bf4c4a2a65ef796a96ca2c00fadad1b7b) chore(langgraph): remove package format - [`5ed4008`](https://github.com/langchain-ai/langgraphjs/commit/5ed4008286dc3441d31592664031359ec7ed44d9) add changeset ### 📊 Changes **2 files changed** (+74 additions, -18 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/eleven-cheetahs-grin.md` (+5 -0) 📝 `libs/langgraph/src/pregel/utils/index.ts` (+69 -18) </details> ### 📄 Description Currently, our approach to combining event listeners has a tendency to emit an annoying 'potential memory leak' error on some versions of node. This is because we add an event listener to the abort signal (whether passed in from options or from the default AbortController that gets created) on every runner tick, which as graphs get over a certain complexity we create more than 10 event listeners on a single signal which triggers the warning. This fixes that by using a hierarchical `MultiAbortSignal` class in place of `combineAbortSignals` which dedupes listeners by ensuring that any signals passed in the constructor arent already tracked by a downstream abort signal. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 20:15:42 -05:00
yindo closed this issue 2026-02-15 20:15:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#1418