OpenMods / OpenPeripheral

https://openmods.info
MIT License
67 stars 25 forks source link

Server crash when cancelling CC initiated AE2 autocrafting due to chunk unload. #243

Open ab9rf opened 9 years ago

ab9rf commented 9 years ago

I've had several server crashes lately that I've isolated to the following scenario:

A ComputerCraft computer connected to an AE2 interface requests autocrafting via the OpenPeripheral-provided API. Before crafting is complete, the chunk containing the computer is unloaded. When the autocrafting is complete, or is cancelled for any reason, the crafting processor attempts to notify the requesting computer of the crafting result, but as it's not there, an exception ("You are not connected to this computer") is raised and the server aborts.

boq commented 9 years ago

Please post server crash report.

EDIT: something like this?

ab9rf commented 9 years ago

Posted here: https://gist.github.com/ab9rf/36f8f19d802deb5fc302.

It appears to me that the only material difference between my crash report and the one you linked is that in my case, the computer was adjacent to the interface instead of being connected via a modem (which appears to be the case in the one you linked), which is why the one you linked has an extra frame in the backtrace.

This crash has been happening reliably a short time after the server goes vacant or all players leave the general vicinity of where the computer in question is located. In some cases, it's on a crafting cancellation (the one I linked is a cancel, presumably because Minecraft decided to unload the chunk the crafting CPU was in); in others, it's been for crafting completion (because the crafting CPU was in a different chunk that hadn't yet been unloaded and thus completed the crafting action successfully but couldn't tell the computer because it had been unloaded).

Placing a chunkloader reliably avoids the crash.

boq commented 9 years ago

Should be (probably) fixed in 8582a4af15364bc25aa21f223543c22f1382de65.