aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorAikar <[email protected]>2020-05-24 13:09:02 -0400
committerAikar <[email protected]>2020-05-24 13:19:08 -0400
commitb6cf80ee6665313aad5ac53788893ad103a0ab9b (patch)
treeae598b70b66e57f6836bd1f4d30da3759fed08e6 /scripts
parentea1a909c8055b63d9732934d90fae3be963e7f3a (diff)
downloadPaper-b6cf80ee6665313aad5ac53788893ad103a0ab9b.tar.gz
Paper-b6cf80ee6665313aad5ac53788893ad103a0ab9b.zip
Preload important classes such as Logger and JLine
This is for 2 reasons: 1) Ensuring our log4j is mostly loaded at OUR version. I've seen stack traces with line numbers that do not match our version. This means that some plugin has shaded in log4j and their loaded version is mixing with ours.... So by at least trying to load a bunch of log4j classes before we load plugins, we can be more sure mixed versions are not loading. 2) If the jar file is replaced while the server is runnimg class not found errors galore This will preloaod a bunch of classes commonly seen to error during shutdown due to this. The goal here is to help let the server shutdown gracefully as possible. Some plugins will still blow up here if they access a class that hadn't been loaded yet, but goal is to at least stop freezing the shutdown process as it does with JLine and Log4j errors requiring an external kill. Ideally you should not replace jars while the server is running, but it is something that happens in development for testing. Updated test server to do a copy though to avoid this happening in Paper development.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/testServer.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/testServer.sh b/scripts/testServer.sh
index 502e7a8e3f..1ce78a3328 100755
--- a/scripts/testServer.sh
+++ b/scripts/testServer.sh
@@ -87,6 +87,7 @@ fi
# JVM FLAGS
#
+cp "$jar" paper.jar
baseargs="-server -Xms${PAPER_MIN_TEST_MEMORY:-512M} -Xmx${PAPER_TEST_MEMORY:-2G} -Dfile.encoding=UTF-8 -XX:MaxGCPauseMillis=150 -XX:+UseG1GC "
baseargs="$baseargs -DIReallyKnowWhatIAmDoingISwear=1 "
baseargs="$baseargs -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=60 "
@@ -94,7 +95,7 @@ baseargs="$baseargs -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThres
baseargs="$baseargs -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5100"
-cmd="java ${PAPER_TEST_BASE_JVM_ARGS:-$baseargs} ${PAPER_TEST_EXTRA_JVM_ARGS} -jar $jar ${PAPER_TEST_APP_ARGS:-} nogui"
+cmd="java ${PAPER_TEST_BASE_JVM_ARGS:-$baseargs} ${PAPER_TEST_EXTRA_JVM_ARGS} -jar paper.jar ${PAPER_TEST_APP_ARGS:-} nogui"
screen_command="screen -DURS papertest $cmd"
tmux_command="tmux new-session -A -s Paper -n 'Paper Test' -c '$(pwd)' '$cmd'"