Flux Networks can cause chunks to be uninhabitable? (NBT Tag that was too big)
ZeekDaGeek opened this issue ยท 5 comments
Alright this was very difficult to debug and get information on so I apologize if it's a little spotty.
Overnight one of my server user's chunks became unloadable by users and it seems like the issue is related to a single Flux Plug. Whenever any client went to the chunks it would error out with the following message:
I then asked a friend to make me a mod to print out some extra information about what tile entities were sending too much information and it kept pointing to this one Flux Plug. When using /nbtedit from FTBUtils on that flux plug it seemed like Array 8 had 29000 booleans stored for some reason.
Is it in any way possible that on chunk loads the client would be sent that data?
Additional information on NBT Data:
The Flux plug was connected as such
Connected to a Powercell (Medium) from RFToolsPower, set to output 13,500 RF. Next to an Information Screen also from RFToolsPower. Edge of chunk boarder.
It seems like based on the logs that the Flux Plug keeps loading and unloading the chunks. Every time it does it adds more booleans to the NBT data. After a few more minutes the boolean index is up to 28,643.
Issue #222 appears to be related, but I'm using fluxnetworks-1.12.2-3.0.15-9.jar so it appears either the issue came back or was never actually fixed.
Edit: I looked into sonar.flux.networks.configurations.dat and it's only 500 bytes and doesn't have any data about unloaded blocks.
Can confirm same issue with Flux Points. Had 4 of them in a single chunk, with each storing some 900kB of nbt data.
What's happening is that a chunk's data is send to the client via a single packet. This packet might be several MB in size. On the client MC / forge enforces a limit of 2MB on the size of packets or NBT data. If a packet exceeds this limit a RuntimeException is raised and the connection is terminated.
This obviously happens with 4 x 900kB nbt data in a packet...
As workaround I have patched out the limits of the forge client version that is currently used by FTB Continuum 1.4.1.
If interested you can find it here: https://github.com/lailani-f/MinecraftForge/tree/1.12.x-nosize
As @ZeekDaGeek pointed out the problem lies in the connection list . More specifically in SyncedValueList -> SonarControlledList::setValueInternal(List). The current implementation adds elements to the list and does not clear it beforehand. This causes the list to grow on each sync.
In the current release 3.0.16 the cause seems to be fixed because the connection lists underlying type was changed to an int[] which syncs atomically.
@lailani-f Is correct. update to 3.0.16 and your chunk should be habitable again. Either way this is fixed.