News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Train disappears in server game

Started by Vladki, February 23, 2019, 01:24:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vladki

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....

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

Yes There was a suitable depot (at least for teleporting).

jamespetts

Can you upload a saved game in which this can reliably be reproduced at a specific place and time?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

I'll try if I can make it happen again. Usually the autosave is broken after that and the demo game is loaded.

jamespetts

Quote from: Vladki 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.

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

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

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...

jamespetts

I see - if you do manage to produce a reproduction case for either this or the original issue, please do let me know.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ACarlotti

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.

jamespetts

Can I ask whether anyone is able to reproduce this issue with to-morrow's nightly build?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

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?

jamespetts

Thank you for the report. May I ask whether there is any means of producing a reliable reproduction case for this?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ACarlotti

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?

Vladki

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.

ACarlotti

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).

Vladki

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.

Vladki

I think I have a reproduction case. Use the stephenson siemens game, switch to "great beltwell railroad", and wait for train to arrive to lakebourne.
While it is waiting for departure, rotate the one way sign at (123,682). Wait for no route message, some time after second repetition of the message you should get desync. After reconnecting, the train is gone. Usually it will desync even if you manage to put the sign back in original position.

I tried similar trick at (888,911) as "raven express transport" but that worked fine - no desync happened and train continued normally even after quite some repeated messages.

The differences may be: there is a passing loop (i.e. signal) between lakebourne and  (123,682), which is not at (888,911).
So I tried to switch an underground one way sign at (43,731) - in an underground passing loop, exacly the same signalling config as at (888,911). It seemed to be OK - no route message disappeared, train started reversing and then I got desync, and train was lost again

Also it may be that there is something wrong with GBR player. It has a checkbox in the list of players, who knows what it means?


Elemental

I think that is the checkbox used to activate AI players

Sirius

Quote from: Vladki on January 26, 2020, 09:10:14 PMAlso it may be that there is something wrong with GBR player. It has a checkbox in the list of players, who knows what it means?
It was started as AI.

jamespetts

Vladki - because the server game changes state regularly, can you upload a saved game representing a point in time in the server game where this can reliably be reproduced based on these instructions? That would be most helpful - thank you.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki