Skip to content

[Bug]: 取消 A2A 任务后,服务端执行一直阻塞不结束 #3574

Closed

Description

@guslegend0510

Describe the bug

客户端取消任务(如 A2aAgent.interrupt())后,服务端会返回 CANCELED 并调用 AgentRunner.stop(),但那次执行永远不会结束,执行线程一直被占用。

原因:AgentScopeAgentExecutor.cancel() 取消的是 doOnSubscribe 里保存的上游订阅,终止信号传不到下游,doFinally 不执行,blockLast() 不返回。

To Reproduce

#3573 中的 A2aHttpEndToEndTest#interruptCancelsRemoteTask(目前 @Disabled)。启用后只有「等待服务端执行结束」这一项失败;服务端日志里该任务只有 Subscribed to executeFunction result stream,没有 Subscribe and process stream output terminated。

Expected behavior

取消后服务端执行结束,线程被释放。

Environment

  • AgentScope-Java Version: 2.1.0-SNAPSHOT(main)
  • Java Version: 17
  • OS: macOS

Activity

  1. added 2 commits that reference this issue on Oct 15, 2026
    1004f81
    7d01396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions