
LitematicaFolia
Server-side Litematica for Paper & Folia: native .litematic paste with full NBT fidelity + Direct Paste from vanilla Litematica clients via the Servux protocol. No /fill spam, no kick, no WorldEdit dep.
Список изменений
Fixed — PasteOperation semaphore deadlock (Folia region self-deadlock)
Completes the v0.4.1 fix, which only moved the pass-1 dispatch loop off the region tick thread.
Root cause. The pass-2 and deferred-physics-sweep loops were chained with a plain (non-async) thenCompose, which runs on the thread that completed the upstream future — a Folia region tick thread (FoliaCompat.runOnRegion completes it there). Those loops then called the blocking acquireSlot() on that region thread; when the region still had more pending chunk tasks than free CHUNK_THROTTLE permits, it parked in Semaphore.acquire() waiting for permits only it could release → self-deadlock. Regions froze indefinitely (observed ~116h on a production server); the Folia Watchdog logged Tick region ... has not responded without ever crashing.
Fix.
- Both continuation loops now run via
thenComposeAsync(..., offRegionExecutor)(Folia async pool / Paper async worker), so everyacquireSlot()runs off-region — a blocked dispatch thread can no longer park a region. acquireSlot()now usestryAcquire(60s): a timeout dispatches the chunk unthrottled and logs a warning instead of blocking forever. The release guard is seeded so an untaken permit is never over-released.
No config/schema change vs 0.4.1 — in-place drop-in. Normal-load behaviour (32 in-flight chunk-task throttle) unchanged.
