Folia icon indicating copy to clipboard operation
Folia copied to clipboard

Async was trigger when players teleport to the edge of a tickregion

Open MrHua269 opened this issue 11 months ago • 12 comments

Stack trace

[03:37:50] [Region Scheduler Thread #2/INFO]: TT_Candy[**********] logged in with entity id 407 at ([world]767.7788530463216, 63.0, 790.3219713260949)
[03:37:53] [Region Scheduler Thread #3/INFO]: TT_Candy issued server command: /tp 0 150 0
[03:37:53] [Region Scheduler Thread #3/ERROR]: [ca.spottedleaf.moonrise.common.util.TickThread] Thread failed main thread check: Cannot asynchronously load chunks, context=[thread=Region Scheduler Thread #3,class=io.papermc.paper.threadedregions.TickRegionScheduler$TickThreadRunner,region={center=[50, 34],world=world}], world=world, chunk_pos=[0, -1]
java.lang.Throwable: null
	at ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(TickThread.java:88) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.level.ServerChunkCache.syncLoad(ServerChunkCache.java:99) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.level.ServerChunkCache.getChunkFallback(ServerChunkCache.java:152) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.level.ServerChunkCache.getChunk(ServerChunkCache.java:320) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.Entity.isInWall(Entity.java:2860) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.LivingEntity.isInWall(LivingEntity.java:4360) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.LivingEntity.baseTick(LivingEntity.java:475) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.Entity.tick(Entity.java:831) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:3133) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.player.Player.tick(Player.java:298) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:1034) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.tick(ServerGamePacketListenerImpl.java:353) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.network.Connection.tick(Connection.java:673) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at io.papermc.paper.threadedregions.RegionizedWorldData.tickConnections(RegionizedWorldData.java:521) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1849) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1668) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:407) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:418) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	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:1575) ~[?:?]
[03:37:53] [Region Scheduler Thread #3/WARN]: [io.papermc.paper.threadedregions.RegionizedWorldData] Failed to handle packet for /111.76.201.162:16138
net.minecraft.ReportedException: Ticking player
	at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:1116) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.tick(ServerGamePacketListenerImpl.java:353) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.network.Connection.tick(Connection.java:673) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at io.papermc.paper.threadedregions.RegionizedWorldData.tickConnections(RegionizedWorldData.java:521) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1849) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1668) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:407) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:418) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	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:1575) ~[?:?]
Caused by: java.lang.IllegalStateException: Thread failed main thread check: Cannot asynchronously load chunks, context=[thread=Region Scheduler Thread #3,class=io.papermc.paper.threadedregions.TickRegionScheduler$TickThreadRunner,region={center=[50, 34],world=world}], world=world, chunk_pos=[0, -1]
	at ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(TickThread.java:89) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.level.ServerChunkCache.syncLoad(ServerChunkCache.java:99) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.level.ServerChunkCache.getChunkFallback(ServerChunkCache.java:152) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.level.ServerChunkCache.getChunk(ServerChunkCache.java:320) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.Entity.isInWall(Entity.java:2860) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.LivingEntity.isInWall(LivingEntity.java:4360) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.LivingEntity.baseTick(LivingEntity.java:475) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.Entity.tick(Entity.java:831) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:3133) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.world.entity.player.Player.tick(Player.java:298) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:1034) ~[folia-1.21.4.jar:1.21.4-DEV-3af04d9]
	... 9 more
[03:37:53] [Region Scheduler Thread #3/INFO]: TT_Candy lost connection: Internal server error
[03:37:53] [Region Scheduler Thread #3/INFO]: TT_Candy left the game

Plugin and Datapack List

plugins [03:52:41 INFO]: Server Plugins (9): [03:52:41 INFO]: Paper Plugins: [03:52:41 INFO]: - HuskHomes, MarkdownChat [03:52:41 INFO]: Bukkit Plugins: [03:52:41 INFO]: - Chunky, GSit, KissKiss, LuckPerms, spark, ViaBackwards, ViaVersion

Actions to reproduce (if known)

  1. Teleport to a place far away from 0, 0(x,z)
  2. Disconnect and wait for a while
  3. Reconnect then teleport back to 0,0(x,z)
  4. Async catcher was trigger and player was kicked

Folia version

ver [03:52:39 INFO]: Checking version, please wait... [03:52:40 INFO]: This server is running Folia version 1.21.4-DEV-dev/hard-fork@3af04d9 (1970-01-01T00:00:00Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT) You are running the latest version Previous version: 1.21.4-DEV-40242ad (MC: 1.21.4)

Other

No response

MrHua269 avatar Feb 09 '25 03:02 MrHua269

1.21.1 1.21.3 1.21.4 reproduced

MrHua269 avatar Feb 09 '25 09:02 MrHua269

1.21.1 1.21.3 1.21.4 reproduced

I try to reproduce, but can't

This server is running Folia version 1.21.4-DEV-dev/hard-fork@3af04d9 (1970-01-01T00:00:00Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.4-DEV-5558184 (MC: 1.21.4)

RitaSister avatar Feb 09 '25 10:02 RitaSister

https://youtu.be/AvQBe0EVZc0?si=Sj7ZsoN-nu2mSnSq

MrHua269 avatar Feb 09 '25 10:02 MrHua269

https://youtu.be/AvQBe0EVZc0?si=Sj7ZsoN-nu2mSnSq

Okay, I will try again to catch this crash and cannot to reproduce

RitaSister avatar Feb 09 '25 10:02 RitaSister

Error seems disappeared when set grid-exponent to 2

MrHua269 avatar Feb 09 '25 10:02 MrHua269

Error seems disappeared when set grid-exponent to 2

Just like a default?

RitaSister avatar Feb 09 '25 10:02 RitaSister

Error seems disappeared when set grid-exponent to 2

Just like a default?

Default value is 4 in folia1.21.4()

MrHua269 avatar Feb 09 '25 10:02 MrHua269

Error seems disappeared when set grid-exponent to 2

Just like a default?

Default value is 4 in folia1.21.4()

Really? I'm set very long time ago to:

threaded-regions: grid-exponent: 2

I will try with a default value (4)

RitaSister avatar Feb 09 '25 10:02 RitaSister

Error seems disappeared when set grid-exponent to 2

Just like a default?

Default value is 4 in folia1.21.4()

Really? I'm set very long time ago to:

threaded-regions: grid-exponent: 2

I will try with a default value (4)

In older version it is 2 but I don't know when it was changed to 4.I tested with new generated default config and it'4

MrHua269 avatar Feb 09 '25 11:02 MrHua269

So I still can't reproduce on new version of fork and with a default value

Error seems disappeared when set grid-exponent to 2

Just like a default?

Default value is 4 in folia1.21.4()

Really? I'm set very long time ago to: threaded-regions: grid-exponent: 2 I will try with a default value (4)

In older version it is 2 but I don't know when it was changed to 4.I tested with new generated default config and it'4

RitaSister avatar Feb 09 '25 11:02 RitaSister

Ok, the technical answer is, if the value is 4, regions will merge if they're more distant from each other.

PedroMPagani avatar Feb 09 '25 12:02 PedroMPagani

Issue disappered on beta/new-scheduler branch

MrHua269 avatar Mar 21 '25 12:03 MrHua269

Proved can still reproduce when teleported the the edge of tickregion

MrHua269 avatar May 01 '25 01:05 MrHua269

Image

Image

Tickregions are displayed using bluemap and this extension: https://github.com/adabugra/bluemap-folia-regions/tree/feature/1.21.4-support

MrHua269 avatar May 01 '25 01:05 MrHua269