Exolius / SimpleBackup

A bukkit plugin to zip up specified maps at regular intervals.
20 stars 19 forks source link

Exception while saving the world #3

Closed mantun closed 12 years ago

mantun commented 12 years ago
java.util.ConcurrentModificationException
  at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
  at java.util.HashMap$KeyIterator.next(Unknown Source)
  at net.minecraft.server.World.a(World.java:2426)
  at net.minecraft.server.ChunkRegionLoader.a(ChunkRegionLoader.java:215)
  at net.minecraft.server.ChunkRegionLoader.a(ChunkRegionLoader.java:85)
  at net.minecraft.server.ChunkProviderServer.saveChunk(ChunkProviderServer.java:163)
  at net.minecraft.server.ChunkProviderServer.saveChunks(ChunkProviderServer.java:212)
  at net.minecraft.server.World.save(World.java:256)
  at org.bukkit.craftbukkit.CraftWorld.save(CraftWorld.java:644)
  at com.exolius.simplebackup.SimpleBackup.doBackup(SimpleBackup.java:153)
  at com.exolius.simplebackup.SimpleBackup$1.run(SimpleBackup.java:60)
  at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
  at java.lang.Thread.run(Unknown Source)

Maybe the world is being saved or chunks are loaded/unloaded while the plugin calls save().

Exolius commented 12 years ago

Any info on reproducing this error?

mantun commented 12 years ago

I did reproduce it: leave the backup running every 5 minutes for a day or two, it happens rarely. It is hard to determine the cause since the code at net.minecraft.server.World.a(World.java:2426) is obfuscated, but I'll see what I can do.

mantun commented 12 years ago

I think I fixed it, I'll leave the server running for a few days to see if it happens again.

mantun commented 12 years ago

Ok, I'm positive I understood the problem and fixed it. It didn't happen at all during my testing. This commit is the fix: https://github.com/mantun/SimpleBackup/commit/08fc28e21b1630fdf2c135086b34684a4781acc0 Sorry, I'm still new to git and don't know the proper way to send it to you. If I create a pull request, it wants you to merge the last 8 commits, instead of just the last one.

Exolius commented 12 years ago

Made a few mistakes while merging the changes, accidently spammed commits because git bash decided to derp out on me, this is the final one: https://github.com/Exolius/SimpleBackup/commit/c99e15b04dc7e05e0b0dec9b5eee07704687d6a5

Nice work fixing it.

Exolius commented 12 years ago

I'm going to compile this and make a new release on the bukkit dev page.

mantun commented 12 years ago

This is great - we currently don't have known issues in the plugin.

Exolius commented 12 years ago

Very nice place to be in, there is always room for improvement though.