Bad server hang while shift crafting in actuator
theboo opened this issue ยท 4 comments
Occultism ver 1.6.5
While on a server, when i shift click to craft a stack at a time, the entire server hangs until the craft is finished. Profile below, it is a 50 second profile and you can see that occultism took up 39 of those 50 seconds(i was shift crafting the whole time). Also video gif below of it in action. In the gif you can see that all the mobs stop moving(those mobs are constantly taking damage and moving) and ToP gives a "waiting on server" message while looking at blocks the entire time the craft is happening
profile:
https://spark.lucko.me/tj7RROTnxl
Further info on this, this issue only occurs when crafting using the remote accessor, when using the actual actuator block it crafts all in one tick instantly... if you use the accessor, it does that weird flashing in the gif above and the whole server hangs until it completes
The change in #284 did not fix the underlying issue, but now it seems to be resolved.
Code that prevented the underlying crafting event system from forcing a recipe lookup wasn't set up in the base class, and somehow I missed setting it up on the storage remote. Now it's in the base class and runs on all storage access methods.
That's a good starting point, will look into it!
Edit: So the culprit for the slowdown is RecipeManager.getRecipe .. which is vanilla (lovely).
That said, based on the GIF I assume it just gets called 64 times, which comes down to the old issue, that the shift craft code seems not to run properly. We're getting closer!