Server: some commands uses duplicated threads (matchQuit, etc)
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 940
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 160
Description
Example for `MageServerImpl::matchQuit` -- it uses a strange code with double threads.
* user call `matchQuit`;
* server creates new thread 1 to execute it;
* thread 1 check user session and creates another thread 2 to continue;
* thread 2 execute real quite game code;

Code added by [that commit](https://github.com/magefree/mage/commits/fea9dfe8f8f144a29dd6d5e099bce660b8d86617). Looks like it was added for error catching, but it will never work -- `execute` hides all errors, so `handleException` never called here. Maybe it require `submit` instead `execute` and result waiting -- then error catching will be workable and double threads logic will be fine with it.
Correct usage from `MageServerImpl::deckSave`:

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.