Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Changing blocks in onDisable will indefinitely pause the watchdog thread during a crash.

Open Warriorrrr opened this issue 3 years ago • 4 comments

Expected behavior

The block to be set, and the watchdog thread to not stay paused.

Observed/Actual behavior

The watchdog thread pauses indefinitely, and the plugin that attempted to set the block never finishes shutting down.

Steps/models to reproduce

Reproducible using the code in this gist: https://gist.github.com/Warriorrrr/41345003f00f2482f3abde0335761ca3

The 'changed block' message will never be logged as the thread gets paused after the setType. (latest.log attached below)

Plugin and Datapack List

No plugins aside from the one used to replicate.

Paper version

This server is running Paper version git-Paper-224 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT) (Git: 42a9c37) You are running the latest version

Other

latest.log jstack.txt

Watchdog thread from the jstack: image

Warriorrrr avatar Mar 04 '22 23:03 Warriorrrr

Can you retest on the latest Paper version?

kennytv avatar Mar 06 '22 08:03 kennytv

Retested on version 234, bug still occurs.

Warriorrrr avatar Mar 07 '22 12:03 Warriorrrr

Replicable with the provided example plugin. The server hangs as the block mutation requests a chunk which is completed on the mainThreadProcessor which, after a long tick time out, dies prior to the execution of the setBlock method.

lynxplay avatar Mar 09 '22 00:03 lynxplay

I've been looking into this issue a bit myself today, and it seems like throwing an exception if the current thread is the watchdog thread before it tries to complete it on the mainThreadExecutor fixes the issue. Would this be worth PRing, or is there possibly a better solution?

Warriorrrr avatar Jun 23 '22 12:06 Warriorrrr