You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OpenShift 4中多个Reactive Spring StateMachine 3.2.0实例单线程运行问题

Spring StateMachine 反应式实例线程复用异常问题

环境配置

  • SpringBoot版本:2.5.9
  • Spring StateMachine版本:3.2.0
  • Java版本:11.0.17(本地Windows环境;OpenShift Pod使用Temurin-11.0.17+8)
  • OpenShift Pod操作系统:Linux gin-backend-numerisation-dev-5897964856-vplzb 4.18.0-305.57.1.el8_4.x86_64 #1 SMP Tue Jul 5 17:55:55 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux

问题现象

  • 本地Windows运行时:每个状态机实例使用独立的可池化线程(如日志中的parallel-3)
  • OpenShift 4 Pod运行时:所有状态机实例复用同一个parallel-1线程,导致异常行为

已尝试方案

曾查阅资料配置线程池,但该配置仅适用于非反应式状态机,对当前使用的反应式异步状态机无效。

日志对比

本地正常日志(节选)

2023-04-12 08:10:24.978 [GIN] [restartedMain] INFO  c.q.h.g.SpringBootApplication - Starting State Machine [Instance_2]...
2023-04-12 08:10:25.072 [GIN] [parallel-3] INFO  c.q.h.g.s.a.StateMachineAction - State Machine: [Instance_2] Received message: [null] From: [INITIAL] To: [STARTED] Running action: [StartAction]
...

OpenShift异常日志(节选)

2023-04-12 08:37:48.128 [GIN] [main] INFO  c.q.h.g.SpringBootApplication - Started SpringBootApplication in 70.821 seconds (JVM running for 74.85)
2023-04-12 08:37:48.821 [GIN] [parallel-1] INFO  c.q.h.g.s.a.StateMachineAction - State Machine: [Instance_1]
Received message: [null] From: [INITIAL] To: [STARTED] Running action: [StartAction]
...

求助

恳请提供针对反应式Spring StateMachine的线程池配置方案或其他解决思路。

内容的提问来源于stack exchange,提问作者Alin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 13:22:36