Disconnecting connectors commonly breaks H2 and O2 distribution

Chris Dusto shared this bug 59 days ago
Considered

I keep running into an issue where, when two conveyer networks are disconnected from each other by means of a connector, the H2 and O2 distribution on both networks can break until either (a) the networks are reconnected or (b) the game/server is restarted. In this situation, an O2/H2 generator can also operate continuously (consuming power and ice) without depositing the generated gas anywhere.


My theory as to the cause derives from a stale cache not properly being rebuilt, even after a failure to transport gas. For instance (assuming a model where gas consumers "pull" from gas producers), take a system with a not-full oxygen tank, connected to two O2/H2 generators; one generator is some distance away (connected via conveyers), while the other is close by but connected by a pair of connectors. If the tank decides to get O2 from the generator attached by connectors and "remember" (cache) this provider, it might not "forget" (invalidate cache) about it when the connectors are disconnected; this results in the tank continuing to ask the now-inaccessible generator for O2, which gets the message to make some O2 (using up ice and power), but then is unable to deliver it (since the networks are disconnected) and instead destroys the produced O2. Meanwhile, the generator that is still accessible to the tank is sitting idle, while the tank is not filling up.

Due to the importance of O2 for life support and H2 for power generation and thrusters, this is currently a major issue for me.

Comments (5)

photo
1

I was looking through a lot of other reports, and it seems the problem might be slightly more complex than I described, as other bugs that result can involve a consumer that has an effectively endless supply of gas. It is still consistent with a stale cache, however.

photo
1

I am not so good in english, maybe a sketch of the problem would help.

What came to mind is:

- Do you use "p" to connect?

- to solve the problem temporarily, use a time block.

photo
1

I do use P nowadays to connect, but I think I first encountered the issue back before I figured out P would dock/undock and I was binding the connector to the toolbar. I'll go back to binding and see if it persists.

How would the timer block be configured for this? Or rather, what actions need to be performed in what order?

photo
1

"p" for connecting and disconnecting the connector is only helpful if you have only one ship. If you use "p" on your ship, it will separate all your connected ships.

- "(a) the networks are reconnected.."

Use the time block to reconnect the connector every few seconds. Simply let the time block activate itself and connect the connector at the same time.

photo
1

I know about the whole P thing, but it hadn't been an issue for me in my builds.


Reconnecting the networks immediately after disconnecting them doesn't lead to anything productive; the intent is for ship/station or ship/ship docking, both of which eventually want the two grids to be detached from one another.

photo
1

The problem isn't multiple things disconnecting at once; the problem is that gas delivery gets broken sometimes after disconnecting two grids. Here's the best drawing I can do without pulling out my tablet:/e77fc13908a03e12f03c51aed1cc683f

photo
photo
1

To the best of my current knowledge, the issue shouldn't be present in the old Github version of the codebase (via code examination); gas transfer is done (best I can tell) with the same mechanism as item transfer, and all caches should be cleared when the connector gets disconnected via a call to MyGridConveyorSystem::FlagForRecomputation(); if this architecture is still the case, the issue would come up with items as well, but it hasn't been observed to happen. My only thought right now is that gases might be using a separate subsystem to transfer, for optimization purposes (since there are relatively few gas-manipulating blocks, while said blocks do transfers pretty much continuously), and said subsystem isn't being signalled correctly.

photo
1

Came across MyResourceDistributorComponent, which looks responsible for electrical, O2, and H2 distribution; either electricity might also be affected, or there's some operation that happens with electricity but not gasses. In any case, this is the most I can really research into the cause without attaching a debugger or properly understanding the code architecture, and I can't think of much more I can contribute to fixing the bug without being asked for explicit information.

photo
1

Hello, Engineer!


Thank you for your feedback! Your topic has been added between considered issues.

Please keep voting for the issue as it will help us to identify the most serious bugs.


We really appreciate your patience.


Kind Regards

Keen Software House: QA Department