Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix asyncCatcher on hardcrash shutdown #12035

Conversation

spring-dependency-management
Copy link
Contributor

@spring-dependency-management spring-dependency-management commented Jan 27, 2025

Paper used to have a flag for AsyncCatcher called enabled, which would be toggled false when shutting the server down during a hard crash as seen here.

       logger.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH ---");
                }

                logger.log(Level.SEVERE, "------------------------------");

                if (isLongTimeout) {
                    if (!server.hasStopped()) {
                        AsyncCatcher.enabled = false; // Disable async catcher incase it interferes with us
                        server.forceTicks = true;
                        if (this.restart) {
                            RestartCommand.addShutdownHook(SpigotConfig.restartScript);
                        }

The reason for this flag is without disabling the main thread checker, shutdown from a thread other than main will obviously fail due to the checks everywhere.

Paper's chunk changes broke this flags functionality, i.e it is set but never actually checked anywhere, this PR re-adds it being checked.

Fixes #12030

@spring-dependency-management spring-dependency-management requested a review from a team as a code owner January 27, 2025 23:53
@lynxplay
Copy link
Contributor

Closed by leaf in a392d47

@lynxplay lynxplay closed this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

Shut down after hard crash fails at savePlayers
2 participants