Commit 955042a
Peter Svensson
close threads at server shutdown
To exit normally all non-daemon threads of the java process
are supposed to have stopped. There are several cases of
EventLoopGroup-created thread pools that are not shut down
as a part of the server shutdown.
These threads are spawned on the first Bedrock player login. The
identified cases are:
- The listener threads in GeyserServerInitializer
- The player threads in GeyserServerInitializer
- The EXECUTOR_SERVICE in the SkinProvider
This patch depends on the PR
GeyserMC/MCProtocolLib#748
submitted to MCProtocolLib to allow the TcpCLientSession to
shut down on process exit.
This is a very quickly thrown together proof of concept to verify that
the execution thread pools left running were what blocked a clean exit
with Geyser active.
Nullify EventLoopGroup variables after shutdown to allow them to be
restarted.1 parent bf81fc1 commit 955042a
File tree
3 files changed
+41
-11
lines changed- core/src/main/java/org/geysermc/geyser
- network
- netty
- skin
3 files changed
+41
-11
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | | - | |
| 79 | + | |
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
86 | | - | |
| 88 | + | |
87 | 89 | | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
134 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
| |||
148 | 159 | | |
149 | 160 | | |
150 | 161 | | |
| 162 | + | |
| 163 | + | |
151 | 164 | | |
152 | 165 | | |
153 | 166 | | |
154 | 167 | | |
155 | | - | |
| 168 | + | |
156 | 169 | | |
157 | 170 | | |
158 | 171 | | |
| |||
Lines changed: 20 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
136 | 149 | | |
137 | 150 | | |
138 | 151 | | |
| |||
302 | 315 | | |
303 | 316 | | |
304 | 317 | | |
305 | | - | |
| 318 | + | |
306 | 319 | | |
307 | 320 | | |
308 | 321 | | |
| |||
320 | 333 | | |
321 | 334 | | |
322 | 335 | | |
323 | | - | |
| 336 | + | |
324 | 337 | | |
325 | 338 | | |
326 | 339 | | |
| |||
349 | 362 | | |
350 | 363 | | |
351 | 364 | | |
352 | | - | |
| 365 | + | |
353 | 366 | | |
354 | 367 | | |
355 | 368 | | |
| |||
388 | 401 | | |
389 | 402 | | |
390 | 403 | | |
391 | | - | |
| 404 | + | |
392 | 405 | | |
393 | 406 | | |
394 | 407 | | |
| |||
620 | 633 | | |
621 | 634 | | |
622 | 635 | | |
623 | | - | |
| 636 | + | |
624 | 637 | | |
625 | 638 | | |
626 | 639 | | |
| |||
646 | 659 | | |
647 | 660 | | |
648 | 661 | | |
649 | | - | |
| 662 | + | |
650 | 663 | | |
651 | 664 | | |
652 | 665 | | |
| |||
0 commit comments