
Deadlocks for complex (single) crafting job
uhloin opened this issue ยท 28 comments
Issue type:
- ๐ Bug
Short description:
There are still situations when complex receipt (specifically for Modern Industrialization) is deadlocked without reason.
Steps to reproduce the problem:
- Use at least this list of mods:
cloth-config-15.0.140-neoforge.jar
commoncapabilities-1.21.1-neoforge-2.9.7-195.jar
cyclopscore-1.21.1-neoforge-1.25.5-702.jar
integratedcrafting-1.21.1-neoforge-1.1.13-269.jar
integrateddynamics-1.21.1-neoforge-1.25.2-1061.jar
integratedscripting-1.21.1-neoforge-1.0.14-229.jar
integratedterminals-1.21.1-neoforge-1.6.7-453.jar
integratedtunnels-1.21.1-neoforge-1.8.32-360.jar
jei-1.21.1-neoforge-19.21.0.247.jar
Modern-Industrialization-2.2.33.jar
extended-industrialization-1.13.2-1.21.1.jar
- Create a complex network with many Industrialization machines to craft "Bronze Drill".
At least all of Bronze Tier or upgrade them to Steel version:
Compressor, Mixer, Furnace, Macerator, Bending Machine, Cutting Machine and Boiler to provide them with steam.
Something like on the screenshot:
- Set all necessary resources and receipts to craft a Bronze Drill from Copper and Tin Dust or Ingots.
Steel Gear or Item Cable may be provided without crafting.
- do not forget to manually fix a buggy recipe for Bronze Dust in the Mixer
- do not forget to insert some Lubricant to Cutting Machine
- Start a Bronze Drill craft.
Occasionally Job stops on infinite deadlock, all machines are doing nothing and have enough resources. If Cancel Job and restart, then possible some progress and possible deadlock again until successful finish.
Sometimes Compressor or Cutting Machine go to deadlock even for simplest recipe like Copper Rod -> Copper Bolt and even Cancel + Restart doesn't help. In this case I break Crafting Interface above the machine and set it again.
This bug is NOT stable and looks like specified steps are not enough to reproduce it. May be there must be more mods and more complex network with some parallel processes as in my current world. But those processes just inserts some resources and definitely does not steal them from this Job. And definitely this is not the case with 2 Jobs.
So, to provide more information I need tests in this world and some additional debugging methods or tools.
For example, dumping to console or to log more details about current state of particular machine and crafting interface may help. May be such additional mode for Wrench to click with Wrench to interface and view such a state dump.
Versions:
- This mod: integratedcrafting-1.21.1-neoforge-1.1.13-269.jar
- Minecraft: 1.21.1
- Mod loader version: NeoForge 21.1.95
Log file:
Please stick to just one issue per report. Problems 2, 3, 4 and 5 don't seem related to 1 at all. And to be able to fix any of this, you need to provide useful reproduction steps so we can actually see what's happening and whether it can be fixed.
Some points in this list seem to point to this feature request: #112 If you agree, feel free to close this issue so we can follow up in #112
Still want to find root cause of crafting deadlock with single complex job. May be you can recommend some debugging tool/mod or create a .jar with some verbose/debug logging of crafting process and machine's states?
Please stick to just one issue per report. Problems 2, 3, 4 and 5 don't seem related to 1 at all. And to be able to fix any of this, you need to provide useful reproduction steps so we can actually see what's happening and whether it can be fixed.
Usually, I write carefully reproduction steps, but crafting deadlock are very unstable bug and I was not able to reproduce it in some minimal environment. In my current local world bugs are ALMOST stable, but this world uses a bunch of other mods and 20 machines.
May be you can recommend some debugging tool/mod or create a .jar with some verbose/debug logging of crafting process and machine's states?
There are not such tools unfortunately. And adding debugging information without knowing more of the precise problem that is occurring is quite difficult to do.
Thanks @uhloin. Could you specify a bit more what you mean exactly by "infinite deadlock"?
- Machines are not working (no animation), input/output slots in them are empty, but energy (steam) level is full.
- State of job table in Crafting Job Terminal is not changing, 'Show Tree' button is active. All cells in the table are yellow, green and (optional) one red like on this screenshot. But on the start there were enough resources.
It's interesting, but after recent update of ID, situation becomes much better, deadlocks become rare and I can reproduce only case with yellow+green+1 red cell and no situation with all yellow+green cells.
@uhloin The plan seems to indicate that 2 copper dust (or some other dust ?) is missing, and could not be extracted from the storage network. Could that be correct?
Could you also show the tree view?
@uhloin The plan seems to indicate that 2 copper dust (or some other dust ?) is missing, and could not be extracted from the storage network. Could that be correct?
Yes, they absent, but if I craft them wit 2nd job, 1st job use it and crafting will success. So they lost somewhere during process and not returned back to network.
Could you also show the tree view?
No, because of scrolling reset.
If the deadlocking happens to be caused by (accidental) concurrent jobs that share ingredients (as descibed by #112), then this may even be a duplicate of that issue. I can't be sure, it's just a hunch.
May be if 1 job may split to more hidden jobs and they can share/steal resources from each other.
At last, I found a way to stable reproduce. On start of craft chest must contain:
- 30+ copper dust (mekhanizm version)
- 30+ tin dust (mekhanizm version)
- 2+ iron gear
- 1+ item pipe
- 1+ fluid pipe
- exactly 8 bronze dust
-- and from Storage Terminal start craft of 4xBronze Drill
Mod set:
almostunified-neoforge-1.21.1-1.2.3.jar
cloth-config-15.0.140-neoforge.jar
commoncapabilities-1.21.1-neoforge-2.9.7-195.jar
cyclopscore-1.21.1-neoforge-1.25.5-702.jar
extended-industrialization-1.13.2-1.21.1.jar
integratedcrafting-1.21.1-neoforge-1.1.13-269.jar
integrateddynamics-1.21.1-neoforge-1.25.2-1061.jar
integratedterminals-1.21.1-neoforge-1.6.7-453.jar
integratedtunnels-1.21.1-neoforge-1.8.32-360.jar
jei-1.21.1-neoforge-19.21.0.247.jar
Mekanism-1.21.1-10.7.8.70.jar
Modern-Industrialization-2.2.33.jar
tesseract-api-neoforge-1.7.0-1.21.1.jar
Try attach a world...
id.zip
It looks like the issue is being caused by your steel furnaces not producing exactly the same type of Bronze Ingot as you defined in your recipes.
I don't know which mods provide them, but your recipe is defined with bronze ingot outputs of an orange color, while the furnace produces ingots of more a yellow-ish color.
This causes Integrated Crafting to not see the recipe as finished, because it is waiting for another item (another type of bronze ingot).
Redefining your recipes to use the other type of bronze ingots as output should resolve the issue.
When I start a crafting job for a drill in your test world, the job indeed halts, and these bronze ingots are in storage, while the crafting jobs are waiting for the other type of bronze ingots:

So problem was in compatibility with JEI, which created the wrong recipe? OK, I see, there is a new version of ID uploaded, I will try experiment with it.
OK, I should investigate further, because still have deadlocks after change types of ingots etc.
Some machines go to strange state after cancel stopped job. After restart job is not resumed. I need to break and set again Crafting Interface to resume job. Or do something with machine connected to that crafting interface. Looks like some resource "hidden" or "locked" inside such crafting interface, May be you know what is it?
Update
Even if remove Mekanism mod, id2.zip cause a deadlock. So root cause is not resources with the same name.
Here are new reproduction steps
-
To simplify test remove almostunified mod from list above, clear config folder,
-
To see mod hints press F3+H in the game or add mod Jade-1.21.1-NeoForge-15.9.3.jar
-
Unzip this world to saves/id1 folder:
Here all receipts are modified to generate always results from Modern Industrialization mod.
But components are still variative (Mekanizm/Modern Industrialization).
Looks like such variative receipts are correct? Start crafting drills... deadlock.
- Unzip this world to saves/id2 folder:
Here all receipts are modified to generate always result AND use components from Modern Industrialization mod.
Start non-veriative crafting drills... deadlock.
Cancel the job, restart ... deadlock.
Now do not cancel, but get 1 tin and 3 copper dusts from chest, go to Mixer (rightmost one) and insert 1 tin and 3 copper dusts into the machine. Crafting suddenly resumes from deadlock and finishes with success.
@uhloin I finally have a fix.
Could you double-check the newest beta release of Integrated Crafting (should land on CurseForge in a few minutes) on your end to see if everything still works as intended? (all my tests still pass at least)
Once you confirm, I will close this issue and backport this fix to 1.20 and 1.19.
Edit: this is the one: https://legacy.curseforge.com/minecraft/mc-mods/integrated-crafting/files/6174996
Thanks for the additional information @uhloin!
I managed to reproduce the problem and derive a code-based test case for it.
I haven't been able to solve the problem yet, but it seems to be caused by the calculated crafting job thinking there's 12 bronze dust in storage, while there's actually only 8 bronze dust.
I suspect something is going wrong with recipes that produce multiple outputs in combination with multi-branching crafting jobs.
I tested it, and id1-id2 worlds become OK, but bug with "locked" state of some interfaces definitely still exists in my "big" world. I reproduces both cases: 1) when state is unlocked after break interface set it again and 2) when state is unlocked after craft something in the connected machine. Looks like 'Cancel' operation still has flaws or some wrong state was saved since time before fix.
Here are steps to reproduce a new deadlock.
Updated mod list:
cloth-config-15.0.140-neoforge.jar
commoncapabilities-1.21.1-neoforge-2.9.7-197.jar
cyclopscore-1.21.1-neoforge-1.25.6-713.jar
extended-industrialization-1.13.6-1.21.1.jar
integratedcrafting-1.21.1-neoforge-1.1.14-281.jar
integrateddynamics-1.21.1-neoforge-1.25.4-1079.jar
integratedterminals-1.21.1-neoforge-1.6.8-466.jar
integratedtunnels-1.21.1-neoforge-1.8.33-370.jar
Jade-1.21.1-NeoForge-15.9.3.jar
jei-1.21.1-neoforge-19.21.0.247.jar
Modern-Industrialization-2.2.34.jar
tesseract-api-neoforge-1.7.0-1.21.1.jar
I switched all Crafting Interfaces to non-blocking mode and started craft of 10x4=40 drills. Result is deadlock. Here is a world in the deadlocked state:
Next, I re-created world like it was BEFORE deadlock:
I started craft of 10x4=40 drills again and catch deadlock, but later, here is deadlocked state: