mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
tests: improved load tests (better logs)
This commit is contained in:
parent
b29a969fdb
commit
690bc36023
4 changed files with 17 additions and 7 deletions
|
|
@ -1004,7 +1004,15 @@ public class MageServerImpl implements MageServer {
|
|||
if (ex.getMessage() != null && !ex.getMessage().equals("No message")) {
|
||||
throw new MageException("Server error: " + ex.getMessage());
|
||||
}
|
||||
logger.error("unknown error", ex); // TODO: on logs spamming (e.g. connection problems) move it inside condition block above
|
||||
|
||||
if (ex instanceof ConcurrentModificationException) {
|
||||
// how-to fix: game objects must be accessible by game thread only, all other threads must work with copies
|
||||
logger.error("wrong threads sync error", ex);
|
||||
} else {
|
||||
// TODO: on logs spamming (e.g. connection problems) move it inside condition block above
|
||||
logger.error("unknown error", ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public class GameSessionWatcher {
|
|||
if (!killed) {
|
||||
Optional<User> user = userManager.getUser(userId);
|
||||
if (user.isPresent()) {
|
||||
// TODO: can be called outside of the game thread, e.g. user start watching already running game
|
||||
// possible fix: getGameView must use last cached value in non game thread call (split by sessions)
|
||||
user.get().fireCallback(new ClientCallback(ClientCallbackMethod.GAME_INIT, game.getId(), getGameView()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue