hiddenswitch / Spellsource

A multiplayer card battle engine
http://hiddenswitch.com
Other
81 stars 42 forks source link

Conceding creates a ConcurrentModificationException #1924

Closed doctorpangloss closed 1 year ago

doctorpangloss commented 1 year ago

Reproduction steps:

  1. Concede.
  2. Observe the following error in the server logs:
    06:07:43.404 [UnityClientBehavior/handleWebSocketMessage{userId=8f1c9243-91fa-47fe-a1a0-bcdcc79c2b56}] WARN  c.h.f.impl.UnityClientBehaviour - unitybehavior did error with 
    java.util.ConcurrentModificationException: null
    at java.base/java.util.ArrayList$Itr.checkForComodification(Unknown Source)
    at java.base/java.util.ArrayList$Itr.remove(Unknown Source)
    at com.hiddenswitch.framework.impl.ServerGameContext.close(ServerGameContext.java:917)
    at com.hiddenswitch.framework.impl.ServerGameContext.endGame(ServerGameContext.java:870)
    at net.demilich.metastone.game.GameContext.concede(GameContext.java:1273)
    at com.hiddenswitch.framework.impl.ServerGameContext.concede(ServerGameContext.java:794)
    at com.hiddenswitch.framework.impl.ServerGameContext.onConcede(ServerGameContext.java:940)
    at com.hiddenswitch.framework.impl.UnityClientBehaviour.handleWebSocketMessage(UnityClientBehaviour.java:285)
    at com.hiddenswitch.framework.impl.UnityClientBehaviour.lambda$new$0(UnityClientBehaviour.java:112)
    at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:264)
    at io.vertx.await.impl.VirtualThreadContext.lambda$run$1(VirtualThreadContext.java:102)
    at io.vertx.await.impl.DefaultScheduler.run(DefaultScheduler.java:67)
    at java.base/java.lang.VirtualThread.run(Unknown Source)
    at java.base/java.lang.VirtualThread$VThreadContinuation.lambda$new$0(Unknown Source)
    at java.base/jdk.internal.vm.Continuation.enter0(Unknown Source)
    at java.base/jdk.internal.vm.Continuation.enter(Unknown Source)

Observed on all platforms.