PaperMC / PaperMC/Folia

Issue with removing player | Ticking player entity

Open
#327 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage type: bug
Dominant language
Shell
Stars
4.4k
Forks
623
PR merge metrics
No merged PRs in 30d

Description

Expected behavior

The method isInWall is not doing a thread check for the whole range. this is weird because this causes players to not be removed from the server due to doTick() getting called.

java.lang.Throwable: null
at ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(TickThread.java:88) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.level.ServerChunkCache.syncLoad(ServerChunkCache.java:99) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.level.ServerChunkCache.getChunkFallback(ServerChunkCache.java:152) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.level.ServerChunkCache.getChunk(ServerChunkCache.java:320) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.world.entity.Entity.isInWall(Entity.java:2869) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.world.entity.LivingEntity.isInWall(LivingEntity.java:4360) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.world.entity.LivingEntity.baseTick(LivingEntity.java:475) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.world.entity.Entity.tick(Entity.java:836) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:3133) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.world.entity.player.Player.tick(Player.java:298) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:1040) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.players.PlayerList.remove(PlayerList.java:599) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.players.PlayerList.remove(PlayerList.java:583) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.network.ServerGamePacketListenerImpl.removePlayerFromWorld(ServerGamePacketListenerImpl.java:2148) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2125) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2111) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.network.Connection.handleDisconnection(Connection.java:976) ~[folia-1.21.4.jar:1.21.4--293dd35]
at io.papermc.paper.threadedregions.RegionizedWorldData.tickConnections(RegionizedWorldData.java:511) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1849) ~[folia-1.21.4.jar:1.21.4--293dd35]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1668) ~[folia-1.21.4.jar:1.21.4--293dd35]
at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:413) ~[folia-1.21.4.jar:1.21.4--293dd35]
at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:445) ~[folia-1.21.4.jar:1.21.4--293dd35]
at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:546) ~[concurrentutil-0.0.3.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

Observed/Actual behavior

Players are not removed on doTick().

Steps/models to reproduce

Not really easy. No idea how it happens.

Plugin and Datapack List
Folia version

dev/hard-fork 3af04d9c6a98d24032bf8c99ad5446b0f381e320

Other

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Entity.isInWall and its call from LivingEntity.baseTick, then trace the ServerChunkCache.syncLoad stack shown in the report. Reproduce or construct a disconnect/removal path through ServerPlayer.doTick and PlayerList.remove; done means players can be removed without the reported tick-thread violation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.