CloudNetService / CloudNet

A modern application that can dynamically and easily deliver Minecraft oriented software
https://cloudnetservice.eu
Apache License 2.0
373 stars 116 forks source link

fix: draining causes jvm halt instead of a stop #1262

Closed 0utplay closed 1 year ago

0utplay commented 1 year ago

Motivation

When enabling draining on a node and stopping all already running services the node should be stopped. Currently instead of stopping the node we cause the jvm to halt therefore the node does not stop correctly and does not exit at all.

Modification

Used the shutdown method in the shutdown handler to stop the node and exit.

Result

The node exits successfully.

github-actions[bot] commented 1 year ago

Test Results

  47 files  ±0    47 suites  ±0   1m 28s :stopwatch: -1s 322 tests ±0  322 :heavy_check_mark: ±0  0 :zzz: ±0  0 :x: ±0  652 runs  ±0  652 :heavy_check_mark: ±0  0 :zzz: ±0  0 :x: ±0 

Results for commit 879277ba. ± Comparison against base commit f0fd6748.

This pull request removes 11 and adds 11 tests. Note that renamed tests count towards both. ``` eu.cloudnetservice.driver.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"this":"is","hello":"world","insane":"!"}}, PRETTY eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [10] 30028, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [2] 3K4V7NUNZ481FZTE2RYICV6K9, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] 97993369, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] Lobbyhello156:79d09abb-bd65-47f4-80ca-2dd0805b9f13 eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] 2014667140552246678, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] ServiceInfoSnapshot(creationTime=1686254354247, address=127.0.1.1:99, processSnapshot=ProcessSnapshot[pid=2244, cpuUsage=71.73913043478261, systemCpuUsage=100.0, maxHeapMemory=536870912, heapUsageMemory=26627792, noHeapUsageMemory=57705664, unloadedClassCount=1, totalLoadedClassCount=8525, currentLoadedClassCount=8524, threads=[ThreadSnapshot[id=1, priority=5, daemon=false, name=Test worker, threadState=RUNNABLE], ThreadSnapshot[id=2, priority=10, daemon=true, name=Reference Handler, threadState=RUNNABLE],… eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [5] 0.7501142, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [6] 0.42735851116987766, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [8] 3, null … ``` ``` eu.cloudnetservice.driver.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"hello":"world","insane":"!","this":"is"}}, PRETTY eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [10] 1020, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [2] J52MKOCOW0JDLO51AQBABY55L, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] 2082568284, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] Lobbyhello156:7cb6d848-9564-4399-8ca4-0d7c8c02c73c eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] -5035254804209372574, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] ServiceInfoSnapshot(creationTime=1687531806668, address=127.0.1.1:99, processSnapshot=ProcessSnapshot[pid=2074, cpuUsage=54.09836065573771, systemCpuUsage=100.0, maxHeapMemory=536870912, heapUsageMemory=27889280, noHeapUsageMemory=58501120, unloadedClassCount=1, totalLoadedClassCount=8529, currentLoadedClassCount=8528, threads=[ThreadSnapshot[id=1, priority=5, daemon=false, name=Test worker, threadState=RUNNABLE], ThreadSnapshot[id=2, priority=10, daemon=true, name=Reference Handler, threadState=RUNNABLE],… eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [5] 0.8568401, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [6] 0.8011428432048809, null eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [8] 9, null … ```

:recycle: This comment has been updated with latest results.