Skip to content

2026-May-09 - 2.7.15513

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 May 00:10
a27f520
fix(battle calc): avoid crash when 'createWorkers' throws (#14367)

Core issue is if 'createWorkers' in battle calc fails with an exception,
that is not raised to the caller and 'isDataSet' does not get updated
properly.

Another way to look at this issue:   workers.size() is 0 when RunCountDistributor
is constructed at ConcurrentBattleCalculator.java:178, but isDataSet was true so
calculate didn't bail out at the early if (!isDataSet) check. That goes
on to create this error.

```
private boolean setGameDataInternal(@Nullable final GameData data) {
  synchronized (mutexCalcIsRunning) {
    cancel();
    cancelCurrentOperation.incrementAndGet();
    isDataSet = createWorkers(data);   // <-- if createWorkers throws...
    return isDataSet;
  }
}
```

Fix: Wrapped createWorkers(data) in setGameDataInternal with a try/catch that resets
isDataSet=false and clears workers on any RuntimeException, then rethrows so
.exceptionally(...) still resolves the latch to false.

Fixes: #14246