SuperMartijn642 / Tesseract

9 stars 9 forks source link

[Bug] Connecting energy transfer with infinite throughput crashes the server #80

Closed Contraxian closed 1 year ago

Contraxian commented 1 year ago

Version Info

Description of the Bug Connecting cryo stabilized fluxducts with infinite throughput directly to a tesseract decreases the tick rate of my server exponentially until it hits 1 tick/minute and the server restarts.

Steps to Reproduce

  1. Connect a powered machine with a tesseract using cryo stabilized fluxducts from thermal expansion.
  2. Input power into the tesseracts channel somewhere else.
  3. Wait 3-5 minutes while lag gets worse.
  4. Server shuts down.

This occurres on a ftb infinity evolved reloaded server.

Screenshots Ill attach a crash report later today

SuperMartijn642 commented 1 year ago

What version of Tesseract are you using?

Contraxian commented 1 year ago

The modpack contains 1.0.28 but ive tried updating to 1.0.34 and the issue still occurs in that one

SuperMartijn642 commented 1 year ago

The modpack contains 1.0.28 but ive tried updating to 1.0.34 and the issue still occurs in that one

Ah I see. 1.0.28 and 1.0.34 are quite different under the hood, so that is rather odd.

Could you maybe create a spark profile when the lag gets bad? Spark shows exactly which parts of the code are taking up tick time. https://www.curseforge.com/minecraft/mc-mods/spark

Contraxian commented 1 year ago

Ok after some testing i am pretty sure the problem can be avoided but setting all tesseracts to either send or receive manually instead of using the hybrid setting. Nontheless i profiled the server after setting a few tesseracts back to hybrid which immediatly brought back the lag as well as the warnings (the longest being 13092 ms behind): https://spark.lucko.me/WGjzC8sZxB turning them back to receive only resolved the issue without having to restart the server. Attached is a crash report from an instance where i let it escalate to a shut down. Not sure if this is worth looking into since there is a workaround but i would definitly be interested in knowing what is the cause of the problem :) crash-2023-05-31_17.56.28-server.txt

SuperMartijn642 commented 1 year ago

It seems Thermal Dynamics passes on requests to insert or extract energy directly to blocks connected to its pipe network. Tesseract does something similar; passing on requests to any blocks surrounding other tesseracts on the same channel. This likely means that whenever a block inserts energy into the pipe network it is passed on to all other tesseracts and then to all pipe networks connected to those tesseracts and then to all tesseracts connected to those pipe networks and so on...

Sadly I don't think there's really a way for me to prevent that without breaking tesseract's functionality. The same holds for Thermal Dynamics' side. A way to prevent it would be to set the tesseracts to receive only or send only, like you mentioned, or to place an energy cell in between pipes to split the giant network of pipes and tesseracts into a bunch of smaller ones.