Repository navigation
Conversation
|
A follow-up from production, in case it helps review. We have been running the same deferral as a server-side mixin on our Sable 2.0.6 server since Oct 16 (Create Aeronautics modpack; NeoForge 21.1.248, later 21.1.264). On Oct 15, before that, the server was killed by the watchdog five times with the Same caveat as in the description: this is the mixin with the same logic, not this exact PR build. No rush on our side. |
|
Fragile blocks are currently an issue, but I'm not too keen on how this PR implements the fix or the LLM smell. |
Fixes #1603.
Problem
FragileBlockCallback.onHitis called from the contact callback whileRapier3D.stepis running, and it breaks the block right there. The neighbour updates fromdestroyBlockgo throughSubLevelPhysicsSystem.handleBlockChange→RapierPhysicsPipeline.handleBlockChange→RapierVoxelColliderBakery.getPhysicsDataForBlock. When the neighbouring block ends up in a state that has no collider yet (leaves changingdistance, vines losing a face, crops, …),Rapier3D.newVoxelCollideris called on the server thread while that same thread is still insidestep. The thread never comes back, and the server watchdog kills it after 60 s.We hit this on a NeoForge 21.1.248 dedicated server (Sable 2.0.6, Create Aeronautics) when ships hit trees. Every crash report had the same stack:
Change
Same idea as 6cd9a29 ("Queue rope wake-ups till after the physics tick"):
IN_PHYSICS_STEPis set,FragileBlockCallback.onHitqueues the break on the steppingSubLevelPhysicsSystemand returns the same result it does today (zero tangent motion, remove collision). Outside the step it still breaks the block straight away.SubLevelPhysicsSystembreaks the queued blocks right afterpipeline.physicsTickreturns, in the same substep and beforeprocessSubLevelRemovals, so sub-levels removed by the breaks are still handled in that substep as before.FragileBlockCallback.breakFragileBlock.Callbacks that override
onHit(bells, beehives, explosives, belts) still change the world during the step. This PR doesn't touch them.Testing
:common:compileJava,:neoforge:compileJava,:fabric:compileJava./sable assemble area, and dropped it about 15 blocks. The server hung and the watchdog crash showed the stack above.Can't keep up. That mixin has the same logic as this patch, but I haven't run this exact jar. A full build needs the Rust natives (Docker), which I didn't set up.