rmct / AutoReferee

Bukkit plugin for automatically refereeing competitive Minecraft matches.
http://rmct.github.com/AutoReferee
GNU General Public License v3.0
35 stars 19 forks source link

File locks and AutoReferee+SportBukkit on Windows #154

Closed authorblues closed 11 years ago

authorblues commented 11 years ago

SportBukkit seems to have some trouble releasing file locks appropriately (or, at least, behavior seems to be inconsistent with CraftBukkit), which is necessary for AutoReferee to cleanup old world folders (only on Windows). This may be something to discuss with @mrapple to see if he knows anything about it, but perhaps is a lost cause.

tonybruess commented 11 years ago

Nothing I'm aware of. Any idea what might be causing it? What's going on exactly?

authorblues commented 11 years ago

The behavior seems to be specific to SportBukkit+Windows (I know, I know), but AutoReferee tries to delete world folders when a temporary world is unloaded. This typically is fine, but the Windows file lock doesn't seem to be released, so the folder can't be deleted. The reports I have heard seems to suggest that it doesn't happen in CB, and I've never heard of such a problem with non-Windows servers.

I don't suspect that SportBukkit is directly to blame, and perhaps the reports I'm getting are incorrect and it still happens on CB, but I need to figure out why those file locks aren't getting released, because it causes those dead world folders to accumulate. Maybe I'll poke around in CB.

hexacyanide commented 11 years ago

Are you passing a save flag while unloading a world? From what I've tested, the file lock isn't released if you don't save a world's data. Use Bukkit.unloadWorld(name, true);.

authorblues commented 11 years ago

I've never heard of that being an issue, but I currently use Bukkit.unloadWorld(name, false);. I'm willing to give this a shot, but that's bizarre if that's actually the problem.

authorblues commented 11 years ago

https://github.com/rmct/AutoReferee/commit/677bb8852584fe36743aa17aebfd9c82d686705b seems to have helped, strangely. Will need to test more, but this is very promising. Thanks @hexacyanide!

authorblues commented 11 years ago

Seems fixed to my liking.

authorblues commented 11 years ago

For reference: https://bukkit.atlassian.net/browse/BUKKIT-2390?focusedCommentId=26117&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-26117

tonybruess commented 11 years ago

Probably should have mentioned this earlier, but PGM uses this.server.unloadWorld(match.getWorld(), true);

authorblues commented 11 years ago

Yeah, but no worries. Just happy to have it figured out. Now if I could only figure out what black magic is causing #160