The International Simutrans Forum

 

Author Topic: Train disappears in server game  (Read 1173 times)

0 Members and 1 Guest are viewing this topic.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2734
    • My addons, mostly roadsigns
  • Languages: EN, CS
Train disappears in server game
« on: February 23, 2019, 01:24:34 PM »
It happened to me already twice, that a train just disappeared in server game. (on the stephensons-siemens server). I was reconstructing the rail tracks and for a short while there might have been no route, but not for long (maybe a minute or two in real time). I got disconnected, and when connected back, one of the trains on the affected line was gone. At least I got some refund for it...    I would expect the train to get stuck and wait for player to fix the tracks....

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Train disappears in server game
« Reply #1 on: February 23, 2019, 01:57:52 PM »
This, I think and if I recall correctly, is the emergency response when a train gets stuck and cannot get to any depot, even by teleporting. Were any suitable depots available anywhere for this to go to?

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2734
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Train disappears in server game
« Reply #2 on: February 23, 2019, 02:25:05 PM »
Yes There was a suitable depot (at least for teleporting).

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Train disappears in server game
« Reply #3 on: February 23, 2019, 03:48:14 PM »
Can you upload a saved game in which this can reliably be reproduced at a specific place and time?

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2734
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Train disappears in server game
« Reply #4 on: February 23, 2019, 03:49:46 PM »
I'll try if I can make it happen again. Usually the autosave is broken after that and the demo game is loaded.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Train disappears in server game
« Reply #5 on: February 23, 2019, 03:54:10 PM »
I'll try if I can make it happen again. Usually the autosave is broken after that and the demo game is loaded.

I am not sure that I follow what you mean by "after that and the demo game is loaded" - can you elaborate?

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2734
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Train disappears in server game
« Reply #6 on: February 23, 2019, 04:29:36 PM »
I'm not sure how it all went, but I think I got disconnected, and when tried to load the automatic save-on-quit game simutrans crashed, and next time showed the demo game...
Whatever I do not recall exactly what happened, and it would be quite hard to replicate...

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Train disappears in server game
« Reply #7 on: February 23, 2019, 05:46:17 PM »
I see - if you do manage to produce a reproduction case for either this or the original issue, please do let me know.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2734
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Train disappears in server game
« Reply #8 on: April 09, 2019, 07:01:31 PM »
Ok, it happened again. I somewhat thought it could happen, but did not save the game before....
I have deleted a rail bridge on active line. Soon after that a train reported no route, and before I managed to finish the earthworks for new bridge I was disconnected from the game. When I returned, the train was sold. It did not take more than a minute between deleting the bridge and disconnecting.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Train disappears in server game
« Reply #9 on: April 09, 2019, 09:07:05 PM »
Is this reliably reproducible; i.e., does it always happen when deleting a railway bridge on an active line? I will not be able to investigate this without being able to reproduce it reliably.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2734
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Train disappears in server game
« Reply #10 on: April 17, 2019, 11:44:18 PM »
I tried to prepare a test case by removing one tile of track and that went without any problems - no route was shown for several minutes, and I had plenty of time to rebuild it and got no desync. However, later when I played and rebuilt tunnels for higher speed (longer curves), I got desynced and lost my train. I seems that it desynced just at the moment when the new track was finished.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Train disappears in server game
« Reply #11 on: April 18, 2019, 12:24:21 AM »
This appears to relate to a loss of synchronisation issue rather than a train disappearing.

I should note that I have recently fixed a bug that would cause trains to teleport in some cases where a token block signal and a choose signal were used in certain combinations; I wonder whether that might have fixed your issue.

Offline ACarlotti

  • *
  • Posts: 483
Re: Train disappears in server game
« Reply #12 on: April 18, 2019, 01:02:08 AM »
The loss of synchronisation could occur if you managed to make changes to the world without (or before) triggering any of the blocks of code that wait for the convoy routing to stop. If that were the cause of the desync, then it would only be triggered by actions taken on one particular step (per convoy) every 25s (the length of time between consecutive route searches for a convoy), so it would be hard to reliably reproduce. However, one approach might be to identify a save game and a precise sequence of clicks that sometimes leads to a desync (on the last click), and then one of us could try setting a breakpoint at the point where the tool action is carried out and stepping through the code from there to see what happens.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Train disappears in server game
« Reply #13 on: April 22, 2019, 11:49:30 PM »
Can I ask whether anyone is able to reproduce this issue with to-morrow's nightly build?

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2734
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Train disappears in server game
« Reply #14 on: May 16, 2019, 08:32:14 PM »
It happened again. This time I was not modyfing the tracks at all. For some unknown reason one train started to complain that the tracks on its way have lower axle load than necessary, which was not true. I also noticed that the train had "reverse schedule" checked, which was also not expected (the schedule does not use the mirror schedule feature). When I opened the train schedule, removed the reversal mark and closed, the train stopped complaining and departed, but shortly after that I got desynced.The train continued its journey in the local disconnected game, but disappeared from server. I just wonder why it is "sold immediately" instead of teleporting to depot in case of routing problems?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Train disappears in server game
« Reply #15 on: May 16, 2019, 09:54:35 PM »
Thank you for the report. May I ask whether there is any means of producing a reliable reproduction case for this?

Offline ACarlotti

  • *
  • Posts: 483
Re: Train disappears in server game
« Reply #16 on: May 16, 2019, 10:50:28 PM »
The first step could be to try reproducing it from the save that you were using before the desync (if you have it). I think this is available in the directory that contains the save directory - you can probably identify the correct save by looking at the most recently modified files.

In this case I do also have a recent save from the server; if the train is already in the unexpected state in that save, I might be able to try reproducing it locally. Which particular train was it?

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2734
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Train disappears in server game
« Reply #17 on: May 16, 2019, 11:07:31 PM »
It was two days ago on siemens game - train departing from turningford towards gosish... Engine was probably LBSCR class J
I do not think that desync produces a save. Saving an online game desyncs by itself. I do not think that save after desync would be useful.
I tried several times to create a no-route situation but never succeded to recreate the desync.

Offline ACarlotti

  • *
  • Posts: 483
Re: Train disappears in server game
« Reply #18 on: May 17, 2019, 12:35:04 AM »
I forgot that this probably wasn't Bridgewater-Brunel.

When you connect to the server, the server needs to save the game before sending it to the client, and the client needs to write that save to a file before loading it. Any other clients also need to save the game to a file. So at any time you can find the save game that was last loaded by your client. For instance, I just started up a server and connected two clients to it on my laptop. I can then find the save games in the folder ~/simutrans - in this instance the server wrote its save to ~/simutrans/server13353-network.sve, the first client wrote to ~/simutrans/client2-network.sve, and the second client wrote to ~/simutrans/client3-network.sve. The first and third files are identical since they were both saves from the server; the second file differed in size, but hopefully not in any manner that would affect synchronisation (as an example, currently open windows would cause save files to differ). If you think you might want to try reproducing something that happened in a server game, then you should make a copy of the relevant file (and if you copy it into the save directory, then you can load it directly onto a locally-running server).

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2734
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Train disappears in server game
« Reply #19 on: August 27, 2019, 11:10:25 PM »
Now I witnessed similar behavior. This time the train which could not find route disappeared (sold), but without desync. It was when electric train had part of electrification missing on its way. However, the electrification was rebuilt shortly after the no route message. I thought that such vehicles will be teleported to depot, instead of being sold. Also I would expect that before teleporting or selling the convoy, a last attempt at finding the route would be done.