CyclopsMC / IntegratedTunnels

Transfer other energy, items and fluids over Integrated Dynamics networks
MIT License
20 stars 13 forks source link

Item transfer sporadically stops working #115

Closed KITbutler closed 6 years ago

KITbutler commented 6 years ago

Occasionally basic item transfer systems using importers/exporters+interfaces with blank variable cards for "input/output all items" simply stop working. There is space in the target inventory and the items can be retrieved manually. Observed with an Industrial Foregoing Plant Gatherer leading into an Ender Chest (the modded version) and with other Ender Chests leading into a drawer controller.

Breaking the logic cable in the same block space as the importer/exporter drops the variable card, replacing both causes item transfer to work normally again.

No clear conditions so far, my best guess is changing dimensions (especially Compact Machines in my case) but nothing close to a 100% trigger rate. The entire system is chunkloaded via ChickenChunks and the Ender Chest channels are high-throughput collecting from multiple farms. Strangely enough one plant gatherer has failed several times now while three others working the same field have not stalled once.


Versions:

- Direwolf20 MC 1.12.2 pack 1.8.0 with manual additions and mod updates
- Forge 14.23.1.2601
- Cyclops Core 0.11.4
- Integrated Dynamics 0.11.4
- Integrated Tunnels 1.5.2
rubensworks commented 6 years ago

Does it completely stop working? Or does it continue again after waiting a while? (like in #108)

Is anyone able to reproduce this using purely vanilla mechanics?

Note to self: probably a caching issue.

KITbutler commented 6 years ago

Inconsistent but mostly seems to slow down. All ID elements are set to 1tick rates but extraction often slows down to once per second. This also happens a lot while inside a Compact Machine with the item storage claimed via FTB utils and chunkloaded via ChickenChunks.

Since most inputs are always-on farms I cannot easily tell the difference between >5s tick rates and a full stop, will try to test in creative with vanilla nether portals.

Edit: tested a bit in creative with the same modpack and could not get a full stop, so it might be a severe slowdown due to the increased load of my "main" world. I did catch the transient end of a slowdown though: the ID transfer system appears to be working at a significantly slower rate while I am in a different dimension despite being chunkloaded.

My test setup consists of a series of TE ducts drawing from an infinite item source into a chest (here: AA large crate, vanilla chest works too). From there ID transfers to a second chest, which is much faster than the ducts while observed directly. The second chest is then emptied into a trash can by a larger number of ducts such that the second chest is always almost empty.

I then enter a nether portal behind me, wait a while in the nether, then go back through the portal and immediately open the first (ID "input") chest. Depending on loading times and waiting time in the nether the chest will contain a significant number of item stacks, which are promptly drained into the second chest and removed as the system picks up speed again once I am in the overworld. I have also observed this behaviour with the ender chests in my compact machines.

Test setup: 2018-02-27_17 21 05

rubensworks commented 6 years ago

Hmm, not sure what could be causing this.

@KITbutler Are you by any chance seeing any messages in the server logs that ticks were skipped? As ID networks tick after the world ticks, this could explain the slowdown.

Do you by any chance have fluid tunnels doing the same thing? If not, could you try doing so near the item transfer setup with a similar velocity? I'm asking this because item transfer has a caching mechanism, and if fluid transfer (that doesn't do any caching) also slows down, then it must be a server ticking issue, and not an item transfer caching issue.

KITbutler commented 6 years ago

Absolutely no effects on fluids, those seem to work fine.

Monitoring from the nether via Ender Storage (tanks/chests) both items and liquids seem to mostly be stable with items only having minor delays once in a while. With three feeding servos extracting every 0.5s each I observe a maximum of 7 stacks in the ID input chest and only for a split second. Changing dimensions does cause skipped ticks, around 50-100 for the nether portal test and up to 500 in my main world.

Pausing the game via opening the menu and resuming also causes a temporary pileup, with no mention of skipped ticks in the log. As the skipped ticks seem to only occur during dimension changes I am not observing anything unusual with /cofh tps either.

Given the computation load of a large drawer storage combined with a high-throughput item transfer network it's possible these short bursts of caching/skipped ticks pile up and my system takes vastly longer to recover due to backlog and a very small net drain rate. I don't understand why breaking and replacing the cables fixes anything though since that should only add to the delays.

rubensworks commented 6 years ago

For reference: the temporary item transfer halt (<10 seconds) is definitely because of caching. This is just something that's there to improve the efficiency in cases when no items need to be transferred.

In any case, I'll add an option soon to disable the caching optimization. If that's implemented, you can use it to check if disabling fixes the issue for you.

rubensworks commented 6 years ago

@KITbutler There seems to be an config option available already to disable caching. Could you try setting inventoryUnchangedTickTimeout to 0 and see what changes? (This might increase server load slightly)

KITbutler commented 6 years ago

In initial testing that seems to have completely eliminated the issues in my main world, hopping back and forth between my fairly active ore processor and the storage hasn't caused anything to stall so far. I'll keep observing it and try to redo the tests in creative. A few drawers also filled up after the config change and didn't cause issues so "no valid destination" doesn't seem to be a problem either (this would cause Thermal Expansion ducts to backstuff until they can transfer the already-extracted items which is why I was paying attention to it)

Anyway, thanks for helping!

rubensworks commented 6 years ago

Ok, thanks for checking. So it's definitely a caching issue, I'll see what I can do.

bpwhelan commented 6 years ago

Idk if this is useful information, but it seems to be an issue (for me at least) with transferring more than 1 TYPE of item over a certain period of time. I was able to keep multiple basic import/interface transfers of cobblestone going for a few days without slowdown, but most transfers with more than 1 type of item (farms mostly) slow down dramatically.

rubensworks commented 6 years ago

@Beannsss Thanks for the info, that might help with finding the cause.