CloudNet icon indicating copy to clipboard operation
CloudNet copied to clipboard

feat: print log message of force stopped services to debug

Open 0utplay opened this issue 2 months ago • 1 comments

Motivation

Some service software like velocity tend to crash / stop on a wrong configuration file without printing any warning message. CloudNet does not pick them up and report them anywere thus it is hard for a user to debug why the service is constantly stopping and the user needs to rely on great timing to see something in the screen.

Modification

Add a listener on the existing CloudServicePreForceStopEvent that prints the cached log lines from a service when its killed. Printing is only done when the feature is not deactivated (set cloudnet.service-watchdog-threshold to <= 0) and the service is only living for the seconds specified in cloudnet.service-watchdog-threshold .

Also the watchdog now only runs every second like it was intended to instead of every tick. Configurable using cloudnet.service-watchdog-interval (millis between to watchdog runs)

Result

Easy debugging for non warn related stop / kills of services.

0utplay avatar Oct 22 '25 19:10 0utplay

Test Results

 56 files  ±0   56 suites  ±0   4m 14s ⏱️ +26s 570 tests ±0  570 ✅ ±0  0 💤 ±0  0 ❌ ±0  937 runs  ±0  937 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 47b4a2cd. ± Comparison against base commit 610fab6b.

This pull request removes 31 and adds 31 tests. Note that renamed tests count towards both.
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [14] 2025-10-15
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 12:28:06.266984640
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 12:28:06.267089024Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 12:28:06.267111867Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 12:28:06.267148355+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 12:28:06.267179903-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2025-10-15T12:28:06.267319314
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2025-10-15T12:28:06.267459114Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2025-10-15T12:28:06.257180317Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [5] 2025-10-15T12:19:46.257183593Z
…
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [14] 2025-10-27
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [23] 19:36:21.644192404
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [28] 19:36:21.644302400Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [29] 19:36:21.644322908Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [30] 19:36:21.644359527+05:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [31] 19:36:21.644393641-03:00
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [34] 2025-10-27T19:36:21.644537070
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [39] 2025-10-27T19:36:21.644719783Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [4] 2025-10-27T19:36:21.623022375Z
eu.cloudnetservice.driver.impl.document.gson.JavaTimeSerializerTest ‑ [5] 2025-10-27T19:28:01.623027204Z
…

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

github-actions[bot] avatar Oct 22 '25 19:10 github-actions[bot]