Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trains were abnormal when server shutdown unusually or crashed. #465

Closed
fjybiocs opened this issue Jan 25, 2023 · 1 comment
Closed

Trains were abnormal when server shutdown unusually or crashed. #465

fjybiocs opened this issue Jan 25, 2023 · 1 comment

Comments

@fjybiocs
Copy link

fjybiocs commented Jan 25, 2023

Info

Please provide the following information:

  • BkCommonLib Version (/train version): build 1438
  • TrainCarts Version (/train version): build 1278
  • Server Type and Version (/version): paper-370

Bug

Description

If the server quits abnormally, the train will probably have the following problems:

  1. trains disconnection,
  2. trains reverse,
  3. trains disappear (in /train list or in Minecraft world)

This does not happen on all trains, but mainly on trains with speeds higher than 0.4.

Expected behaviour

The plugin should save the train state at regular intervals and load it when the server starts to ensure that the plugin can counteract abnormal server exits.

Actual behaviour

As description.

Steps to reproduce

  1. Create a railway, make sure the railroad is long enough for the train to leave the chunks loaded by the player.
  2. Create a train with maxspeed 5 that will force chunks to be loaded.
  3. Lauch the train.
  4. When the train is moving, kill the server process.
  5. Start the server, the train will disappear.

Additional Information

My players and I have enjoyed this plugin so much that I created a server where railroads are the primary mode of transportation and players use high speed railroads instead of neither ice paths, so there are a large number of railroads in the server, each running multiple trains with different functions.

Server crashes are unavoidable under any circumstances, and after several recent crashes players have been devastated by the need to rearrange their complex train systems. I am therefore very anxious for the plugin to counteract data anomalies caused by abnormal server shutdowns, for example by storing the status of running trains at regular intervals and loading them when the server starts.

I think this is a very necessary feature for applying this plugin to large servers built with rail as the main mode of transportation.

@bbayu123
Copy link
Collaborator

bbayu123 commented Jun 3, 2023

TrainCarts does have logic to try to mitigate this. However, a crash can cause the trains that TC knows and the real entities in the world to desync, which then TC isn't able to fix the situation. It is never guaranteed that TC can recover trains from a crash, and this will never be the case.
If server crashes are unavoidable in your situation, then you should either fix that, or only spawn trains when needed instead of keeping them running at all times.

@bbayu123 bbayu123 closed this as completed Jun 3, 2023
@bbayu123 bbayu123 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants