Skip to content

Restore detailed entity information in watchdog dumps - #14242

Open
electronicboy wants to merge 1 commit into
mainfrom
restore-entity-ticking-watchdog
Open

Restore detailed entity information in watchdog dumps#14242
electronicboy wants to merge 1 commit into
mainfrom
restore-entity-ticking-watchdog

Conversation

@electronicboy

Copy link
Copy Markdown
Member

Watchdog dumps lost their per-entity detail in 1.21.4. When the server thread is stuck, the dump still prints the thread stack, but not which entity is being ticked or what state it is in — which is often the part that actually identifies the problem. An excessive movement vector, or the position of a busted entity so it can be found and removed, is exactly the information that makes a hang diagnosable, and its absence has been noticed more than once.

The instrumentation was never removed, only the readout. ServerLevel still sets and clears currentlyTickingEntity around every tickNonPassenger, and Entity still records the move() start position and move vector under posLock, so servers have been paying for the tracking since 1.21.4 with no way to read any of it back out.

It was dropped incidentally while the Detail more information in watchdog dumps feature patch was inlined into the per-file patches (48f34f8c90, 13b890950d, 3b0b3a0aef) — the call site was replaced with dumpAllChunkLoadInfo, the bodies were emptied, and the four Entity accessors that exposed the move state went with them, leaving those fields private with no reader.

This restores dumpTickingInfo/dumpEntity and the accessors. Notes on the two judgement calls:

  • The readout lives in WatchdogThread rather than FeatureHooks, since none of it is chunk-system dependent.
  • The dump is wrapped in a catch-all. It reads concurrently mutating entity state off the server thread, so an exception there would previously have cost both the thread dump and the halt that follows it on a long timeout.

Verified by hanging the server thread inside Entity#move (fall damage is dispatched from within move, so the move-vector branch is exercised too) and reading the early-warning dump:

Ticking entity: minecraft:pig, entity class: net.minecraft.world.entity.animal.pig.Pig
Entity status: removed: false, valid: true, alive: true, is passenger: false
Entity UUID: 7b2d530e-14b9-4265-8c75-0e00c7336f7d
Position: world: 'world' at location (0.5, -60.0, 0.5)
Velocity: (0.0, -2.0258051816346994, 0.0) (in blocks per tick)
Entity AABB: AABB[0.05, -60.0, 0.05] -> [0.95, -59.1, 0.95]
Move call information:
Start position: (0.5, -59.82978164948692, 0.5)
Move vector: (0.0, -2.0258051816346994, 0.0)

Two limits worth knowing: only the outermost ticking entity is reported, since currentlyTickingEntity is a single reference assigned only when null; and the packet-handling branch is compile-verified only, as testing it needs a connected client.

@electronicboy
electronicboy requested a review from a team as a code owner September 9, 2026 21:38
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Sep 9, 2026
@electronicboy electronicboy added the publish-pr Enables a workflow to build Paperclip jars on the pull request. label Sep 9, 2026
Watchdog dumps lost their per-entity detail in 1.21.4. The instrumentation
survived - ServerLevel still tracks the currently ticking entity, and Entity
still records the move() start position and move vector under posLock - but
the code that printed it was dropped while the "Detail more information in
watchdog dumps" feature patch was inlined into the per-file patches, along
with the four Entity accessors that exposed the move state.

This restores the readout and those accessors. It lives in WatchdogThread
rather than FeatureHooks since none of it is chunk-system dependent. The dump
is wrapped in a catch-all: it reads concurrently mutating entity state off the
server thread, and an exception there would otherwise cost us the thread dump
and the halt that follows it.
@electronicboy
electronicboy force-pushed the restore-entity-ticking-watchdog branch from 48a4205 to 5bf6568 Compare September 9, 2026 21:42
@papermc-pr-publishing

papermc-pr-publishing Bot commented Sep 9, 2026

Copy link
Copy Markdown

Last updated for: 5bf65680a1d9009b0681ad462ba62516efc3a0b6.

Download the Paperclip jar for this pull request: paper-14242.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/pr14242") {
        name = "Maven for PR #14242" // https://github.com/PaperMC/Paper/pull/14242
        mavenContent {
            includeModule("io.papermc.paper", "dev-bundle")
            includeModule("io.papermc.paper", "paper-api")
        }
    }
}

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