-
Notifications
You must be signed in to change notification settings - Fork 626
Closed
Labels
type/bugIs a bug reportIs a bug report
Milestone
Description
When I've been trying to use singleton of PersistStatemache(according to the perssit demo( demo.persist.Persist)) with multiple test steps I've faced with deadlock problem. I just use the syncTaskExecutor by default and let the thread sleep to simulate the slow processing. This is with 1.2.5.RELEASE.
public void configure(StateMachineConfigurationConfigurer<String, String> config)
throws Exception {
config
.withConfiguration()
.autoStartup(true);
}
public void pay() {
logger.info("WAITING_FOR_RECEIVE " +Thread.currentThread());
try {
Thread.sleep(3000);
logger.info("wakeup" + " " + Thread.currentThread());
} catch (InterruptedException e) {
e.printStackTrace();
}
}
My test case:
@Test
public void doSignals() throws InterruptedException {
int cnt = 5;
Thread[] threads = new Thread[cnt];
for (int i = 0; i < cnt; i++) {
threads[i] = new Thread(() -> {
try {
persist.change(1L, "PAY");// accpet the same event
} catch (Exception e) {
e.printStackTrace();
}
});
}
for (Thread t : threads) {
t.start();
}
for (Thread t : threads) {
t.join();
}
}
jstack result:
By the way my spring statemachine version is 1.2.5.RELEASE
Metadata
Metadata
Assignees
Labels
type/bugIs a bug reportIs a bug report