Skip to content

Conversation

@jpenilla
Copy link
Member

@jpenilla jpenilla commented Feb 10, 2026

This fixes a race where a late log message to the async appender could cause console reinitialization during shutdown

Also fixes issues when plugin log messages with classloader scoped context tries to print after the plugin classloader is closed by flushing the async appender as a part of disabling plugins.

This fixes a race where a late log message to the async appender could cause console reinitialization during shutdown
@jpenilla jpenilla requested a review from a team as a code owner February 10, 2026 01:41
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Feb 10, 2026
This ensures any plugin log messages holding classloader scoped context get printed before the classloader is closed, avoiding certain plugin errors being unloggable.
@jpenilla jpenilla changed the title Move all logging/console cleanup to LogManagerShutdownThread Improve logging robustness Feb 10, 2026
@jpenilla jpenilla added the publish-pr Enables a workflow to build Paperclip jars on the pull request. label Feb 10, 2026
@papermc-pr-publishing
Copy link

papermc-pr-publishing bot commented Feb 10, 2026

Last updated for: 17a34a8bc08925b4c2f6c413b2f2013b7f64a390.

Download the Paperclip jar for this pull request: paper-13622.zip

Maven Publication

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven("https://maven-prs.papermc.io/Paper/pr13622") {
        name = "Maven for PR #13622" // https://github.com/PaperMC/Paper/pull/13622
        mavenContent {
            includeModule("io.papermc.paper", "dev-bundle")
            includeModule("io.papermc.paper", "paper-api")
        }
    }
}

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves shutdown-time logging behavior to avoid races with Log4j async logging and plugin-classloader-scoped log messages during plugin disable/unload.

Changes:

  • Adds an explicit flush(timeout, unit) API to Log4j’s AsyncAppender via a Paper patch.
  • Flushes Log4j async appenders during plugin disable before unloading plugin classloaders.
  • Moves/removes some shutdown-time logging cleanup steps from MinecraftServer shutdown flow into LogManagerShutdownThread.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
paper-server/src/main/java/io/papermc/paper/util/LogManagerShutdownThread.java Adds additional shutdown cleanup (force reset + terminal console close) around Log4j shutdown.
paper-server/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java Flushes Log4j async appenders during plugin disable to prevent late log processing after classloader close.
paper-server/patches/sources/net/minecraft/server/MinecraftServer.java.patch Removes terminal console close + log manager reset from the server’s shutdown routine.
paper-server/patches/features/0032-Add-explicit-flush-support-to-Log4j-AsyncAppender.patch Introduces explicit flush support to Log4j async logging internals.
paper-server/patches/features/0028-Optimize-Hoppers.patch Patch metadata/index adjustment only.
paper-server/patches/features/0025-Optimise-EntityScheduler-ticking.patch Patch metadata/index adjustment only.
paper-server/patches/features/0020-Incremental-chunk-and-player-saving.patch Patch metadata/index adjustment only.
paper-server/patches/features/0001-Moonrise-optimisation-patches.patch Patch metadata/index adjustment only.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

publish-pr Enables a workflow to build Paperclip jars on the pull request.

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

1 participant