[SPIGOT-2385] FileIOThread will cause chunk overwrites/data loss on bigger servers Created: 11/Jun/16 Updated: 20/Jul/16 Resolved: 12/Jun/16 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Major |
Reporter: | Kademlia | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 1 |
Labels: | None |
Attachments: |
![]() ![]() |
||||||||
Issue Links: |
|
Description |
Hey, okay this is a bigger one and took a long time to find. I am pretty sure this is a vanilla bug too (but very hard to test). I want to validate my concerns here before reporting to mojang. Groundwork:
Problem: Reproduction: if (RegionFileCache.a.size() >= 2) {
a();
}
Reprodution of chunk-regenerations:
One way to fixing this: // Kade possibly broken by FileIOThread! too @Deprecated public static DataInputStream c(File file, int i, int j) { RegionFile regionfile = a(file, i, j); return regionfile.a(i & 31, j & 31); } // Kade is broken by FileIOThread! This will return a reference to a file that may be removed before it is used! @Deprecated public static DataOutputStream d(File file, int i, int j) { RegionFile regionfile = a(file, i, j); return regionfile.b(i & 31, j & 31); } public static synchronized NBTTagCompound fixedc(File file, int i, int j) throws IOException { RegionFile regionfile = a(file, i, j); DataInputStream datainputstream = regionfile.a(i & 31, j & 31); if (datainputstream == null) return null; // ChunkRegionLoader loadChunk return NBTCompressedStreamTools.a(datainputstream); } public static synchronized void fixedd(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { RegionFile regionfile = a(file, i, j); DataOutputStream dataoutputstream = regionfile.b(i & 31, j & 31); NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); // from ChunkRegionLoader b(...) dataoutputstream.close(); } |
Comments |
Comment by md_5 [ 12/Jun/16 ] |
BTW this is already upstream: MC-10976 |
Comment by Kademlia [ 12/Jun/16 ] |
Hey, Apart from that on a server with ~100 users the limit should be hit several times a day under normal usage. This is caused by the FileIOThread functionality. |
Comment by md_5 [ 12/Jun/16 ] |
Please refrain from commenting on tickets unless they are clearly related. It just confuses the matter. |
Comment by Lokio Case [ 12/Jun/16 ] |
Yes, I've seen this by flying around in spectator. No, I don't think it has to do with this specific "limit" but does have something to do with saving and loading of chunk data. |
Comment by md_5 [ 12/Jun/16 ] |
You can load 262,144 chunks just at once just by flying around on spectator mode? Kademlia if we 'fix' this, it will just be bumping up the limit and sending the bug upstream. Have you actually seen this happen? |
Comment by Lokio Case [ 11/Jun/16 ] |
I'm running into this just flying around too fast in spectator mode. |
Comment by Kademlia [ 11/Jun/16 ] |
Forgot to write why this is mostly a problem on bigger servers: |