CyclopsMC / IntegratedCrafting

Craft stuff in Integrated Dynamics networks
MIT License
7 stars 6 forks source link

Server Crash with Craft Writer #62

Closed joey-drake closed 3 years ago

joey-drake commented 3 years ago

Issue type:


Short description:

Server crashing shortly after placing variable card into crafter

Steps to reproduce the problem:

  1. Place craft writer onto crafting table
  2. Create a recipe variable card
  3. Place variable into craft writer
  4. Server crashing from single server tick taking too long

Expected behaviour:

n/a


Versions:

Log file: https://pastebin.com/yHtPAbbC

rubensworks commented 3 years ago

Thanks for reporting!

rubensworks commented 3 years ago

The provided steps don't reproduce the problem here, so I'm going to need a lot more information.

joey-drake commented 3 years ago

Ok, no problem!

rubensworks commented 3 years ago

2x interface

What are these interfaces connected to? Are these (very) large storage blocks by any chance?

Did you experience any performance issues with the older IT/IC versions?

In any case, a world+pack share (+coordinates of the problematic crafter) would definitely be valuable, as I probably won't be able to reproduce otherwise.

joey-drake commented 3 years ago

One was a barrel with one pair of shears and the other was a barrel with about 20 petals in it. (vanilla barrels)

I ran into the issue with player simulators crashing the server, but I hadn't used a crafter on the server until the most recent version. This was my first and only time using one.

Let me download the save and remake the network with the crafter. I had to delete integrated crafting to get the server to boot.

joey-drake commented 3 years ago

Alrighty,

Here is the link to the world save download. The network wouldn't function 100% correctly as is (would need to filter what's being exported to one of the dispensers), but it was crashing the world like this so you should be able to reproduce. There is a variable card with the recipe in an item frame. Just place that into the craft writer and it should timeout the world.

Coords: -178 84 960

Pack: All The Mods 6 v 1.6.3c I also have the integrated mods updated to: Integrated Crafting 1.0.15 Integrated Dynamics 1.8.2 Integrated Tunnels 1.8.1

If it's easier I'm happy to provide my mod folder or instance.

I also placed a waystone at spawn so you can use that to get to the crafter.

Let me know if you need anything else and thank you for your work.

rubensworks commented 3 years ago

If it's easier I'm happy to provide my mod folder or instance.

That might be easier indeed, thanks!

joey-drake commented 3 years ago

Here you are! Save is "New Life"

rubensworks commented 3 years ago

Damn, packs have gotten big today. My machine isn't strong enough to run your pack properly. I also seem to be unable to teleport because of creative/commands being disabled.

So not sure if/when I'll be able to look into this. A world with minimal modset that reproduces the problem would be easier to debug.

joey-drake commented 3 years ago

lol they sure have You can open to LAN and enable cheats. Sorry, I forgot to enable cheats in the save.

As you said, packs have gotten big so narrowing it down with 200+ mods without knowing where to start is quite the task. I'll put the issue in the pack's github as well and see if anyone there is feeling inspired to try to find the conflict. Thanks for all of your communication. I'm sure maintaining your projects is quite the task.

rubensworks commented 3 years ago

Ok, I was able to reproduce the problem with this world. Next step will be to figure out why it is happening. Since this pack takes forever to load on my machine, this might take a while though...

Note to self: relevant coordinates are -178 84 -960 Create a custom IC build with debug logs around the observer invocation logic.

EDIT: when emitting debug logs, the problem does not occur anymore, which may indicate a race condition somewhere. (probably with the observer)

EDIT2: Hypothesis: sync observer starts, but is slow. 1ms later, async observer starts, and is faster. They run interweaved, and due to the synchronized blocks, they block each other. Possible solution: don't allow async observations (return early in observe) until sync observer finishes.

rubensworks commented 3 years ago

@catsbyte It took me a while, but I managed to discover and resolve the problem! 🎉

Everything seems to be working properly on my end, but it would be good if you could confirm that no weird side-effects arise in your world. Could you try out the latest ID dev build? (no changes were done in IC)

joey-drake commented 3 years ago

Nice! That's exciting, I'll give it a try tonight after work