You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-19 15:06:19 +00:00
fix: bound the move-blocking Future.get in RoomUserWalkEvent
roomUnit.getMoveBlockingTask().get() blocked the Netty event loop with no timeout; a stuck/delayed move-blocking task would park the worker thread (and every client on it) indefinitely. Wait at most 2s, then proceed with the walk.
This commit is contained in:
+7
-1
@@ -163,7 +163,13 @@ public class RoomUserWalkEvent extends MessageHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (roomUnit.getMoveBlockingTask() != null) {
|
if (roomUnit.getMoveBlockingTask() != null) {
|
||||||
roomUnit.getMoveBlockingTask().get();
|
try {
|
||||||
|
// Bound the wait so a stuck/delayed move-blocking task can't park
|
||||||
|
// the Netty event loop (and thus every client on it) indefinitely.
|
||||||
|
roomUnit.getMoveBlockingTask().get(2, java.util.concurrent.TimeUnit.SECONDS);
|
||||||
|
} catch (java.util.concurrent.TimeoutException | java.util.concurrent.ExecutionException | InterruptedException e) {
|
||||||
|
// proceed with the walk regardless
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean needsLocationResync =
|
boolean needsLocationResync =
|
||||||
|
|||||||
Reference in New Issue
Block a user