Skip to content

Server does not restart after stop command (Windows, start.bat loop) #297

@Enootkin

Description

@Enootkin

Environment
Core: Youer
Version: youer-1.21.1-e1582cf4-server.jar
OS: Windows
Java: (укажи свою версию, если нужно)
Startup method: start.bat with restart loop

Description

After executing the stop command from the server console, the server shuts down correctly, but does not start again, even though it is launched via a start.bat script with an infinite restart loop.
The batch file continues execution (messages about shutdown and restart timeout appear), but the Java process does not relaunch the server.
This issue is reproducible every time when stopping the server via the stop command.
Expected behavior
After executing stop, the server process should terminate normally and the batch script should start the server again.
Actual behavior
Server stops
start.bat continues execution
Server does not start again
Manual restart is required

start.bat
`@echo off
chcp 65001 >nul

set HTTP_PROXY=
set HTTPS_PROXY=
set ALL_PROXY=
set http_proxy=
set https_proxy=
set all_proxy=

:loop

set "JAVA_MEM=-Xms12G -Xmx16G"
set "JAVA_GC=-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:MaxGCPauseMillis=60 -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxTenuringThreshold=1 -XX:+UseStringDeduplication"
set "JAVA_UTF=-Dfile.encoding=UTF-8 -Djava.net.useSystemProxies=false"
set "JAVA_LOG=-Dlog4j.configurationFile=log4j2.xml"
set "AGENT=-javaagent:authlib-injector-1.2.7.jar=https://launcher.aynoot.org/api/v1/integrations/authlib/minecraft"

java %JAVA_MEM% %JAVA_GC% %JAVA_UTF% %JAVA_LOG% %AGENT% --add-modules=jdk.incubator.vector -jar "youer-1.21.1-e1582cf4-server.jar" nogui

echo.
echo Server stopped.
echo Restarting in 5 seconds...
timeout /t 5 >nul
goto loop`

Additional notes
The issue occurs specifically after using the in-game / console stop command
The same restart script works correctly with other server cores
Possibly related to how Youer terminates the JVM process or handles shutdown hooks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions