Skip to content

[BUG] SequentialReact 多个智能体顺序执行会阻塞? #3873

@sunxien

Description

@sunxien

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

SequentialAgent.builder() .name("test_workflow") .executor(this.customExecutor) // 问题:如果未指定自定义的线程池 .subAgents(List.of(agent1, agent2, agent3)) .build();
多个智能体顺序执行,为什么会阻塞?阻塞的堆栈是:

`
"HttpClient-1-SelectorManager" #16 daemon prio=5 os_prio=31 cpu=4.52ms elapsed=163.49s tid=0x00007f95fd4af800 nid=0x9d0f runnable [0x00000003061f7000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.KQueue.poll([email protected]/Native Method)
at sun.nio.ch.KQueueSelectorImpl.doSelect([email protected]/KQueueSelectorImpl.java:122)
at sun.nio.ch.SelectorImpl.lockAndDoSelect([email protected]/SelectorImpl.java:129)
- locked <0x00000007009ad2b8> (a sun.nio.ch.Util$2)
- locked <0x00000007009ad260> (a sun.nio.ch.KQueueSelectorImpl)
at sun.nio.ch.SelectorImpl.select([email protected]/SelectorImpl.java:141)
at jdk.internal.net.http.HttpClientImpl$SelectorManager.run([email protected]/HttpClientImpl.java:892)

"HttpClient-2-SelectorManager" #17 daemon prio=5 os_prio=31 cpu=2501.12ms elapsed=163.46s tid=0x00007f95fdaa5400 nid=0x914f runnable [0x00000003062fa000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.KQueue.poll([email protected]/Native Method)
at sun.nio.ch.KQueueSelectorImpl.doSelect([email protected]/KQueueSelectorImpl.java:122)
at sun.nio.ch.SelectorImpl.lockAndDoSelect([email protected]/SelectorImpl.java:129)
- locked <0x0000000700998dd0> (a sun.nio.ch.Util$2)
- locked <0x0000000700998d78> (a sun.nio.ch.KQueueSelectorImpl)
at sun.nio.ch.SelectorImpl.select([email protected]/SelectorImpl.java:141)
at jdk.internal.net.http.HttpClientImpl$SelectorManager.run([email protected]/HttpClientImpl.java:892)
`

Expected Behavior

Program should exit if finished

Steps To Reproduce

JDK 17, 21

Environment

Spring AI Alibaba version(s): 

<dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-openai</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba.cloud.ai</groupId>
            <artifactId>spring-ai-alibaba-agent-framework</artifactId>
            <version>1.1.0.0-RC1</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba.cloud.ai</groupId>
            <artifactId>spring-ai-alibaba-graph-core</artifactId>
            <version>1.1.0.0-RC1</version>
        </dependency>

Debug logs

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions