Skip to content

Conversation

mengnankkkk
Copy link
Contributor

@mengnankkkk mengnankkkk commented Sep 25, 2025

Describe what this PR does / why we need it

fix llmnode thread safety the message is thread unsafe

Does this pull request fix one issue?

Close #2510

Describe how you did it

Create copies of local variables to handle state

Describe how to verify it

Special notes for reviews

@github-actions github-actions bot added the area/graph SAA Grpah module label Sep 25, 2025
@mengnankkkk
Copy link
Contributor Author

This way to slove one node,will change it

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes thread safety issues in the CompiledGraph class by changing from storing pre-created node instances to storing node factory functions. This ensures that each request gets a fresh instance, preventing shared state issues in concurrent environments.

Key changes:

  • Replace the nodes map storing AsyncNodeActionWithConfig instances with nodeFactories map storing Node.ActionFactory functions
  • Update all references to create new instances on-demand using the factories
  • Add comprehensive test coverage for concurrent node creation scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
CompiledGraph.java Core thread safety fix - replaces instance storage with factory pattern
NodeFactoryPatternTest.java New test suite verifying factory pattern and concurrent access behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

mengnankkkk and others added 2 commits October 1, 2025 18:42
…i/graph/CompiledGraph.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…i/graph/CompiledGraph.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mengnankkkk mengnankkkk requested a review from Copilot October 1, 2025 12:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

mengnankkkk and others added 2 commits October 1, 2025 20:39
…i/graph/CompiledGraph.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…i/graph/CompiledGraph.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graph SAA Grpah module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Graph模块LlmNode内messages字段有并发问题
1 participant