The International Simutrans Forum

 

Author Topic: [BUG] Deadlocks caused by depots  (Read 270 times)

0 Members and 1 Guest are viewing this topic.

Offline Freahk

  • Devotee
  • *
  • Posts: 1324
  • Languages: DE, EN
[BUG] Deadlocks caused by depots
« on: July 08, 2020, 09:16:32 AM »
Hey there,
There is a design issue with depots causing deadlocks.
Trains entering a depot will not reservate the tile of the depot itself. Trains on a depot tile will however occupy that tile.
This will cause deadlocks when multiple trains in a row enter a depot for replacement no matter the used signalling system.

Would it be possible to either
a) Make signalling systems to reservate the depot tile including (in case of drive by sight this would require the depot to be part of a drive by sight block) or
b) Ignore collisions on the depot tile entirely (does also require drive by sight blocks) or
c) Make through depots, so one side can be used as an entry and the other one as an exit.
« Last Edit: September 01, 2020, 04:17:42 PM by Freahk »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20274
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Deadlocks caused by depots
« Reply #1 on: July 21, 2020, 11:26:36 PM »
Thank you for the report. It would be helpful to have a minimal reproduction case for this to allow for more detailed testing. I should note that (c) would be a very major project, as it would fundamentally change the way that depots work (requiring a large set of new graphics for each pakset), and is not likely to be feasible in the foreseeable future.

I will have to investigate very carefully all the implications of either (a) or (b), or possible other solutions.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20274
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Deadlocks caused by depots
« Reply #2 on: July 29, 2020, 08:53:53 PM »
Looking into this further, I am afraid that I am unable to reproduce this: railway vehicles do appear to reserve depot tiles both when entering and leaving the depot. Are you able to upload a reliable reproduction case of the circumstance where this does not occur?

Offline Freahk

  • Devotee
  • *
  • Posts: 1324
  • Languages: DE, EN
Re: Deadlocks caused by depots
« Reply #3 on: July 29, 2020, 09:11:04 PM »
There are no special circumstances. Just make sure multiple vehicles in a row are entering and leaving a depot, for examply by using the "replace" feature.

Edit: See the two attached saves.
The first using drive_by_sight, as there is nothing else available at that early era.
The latter using Absolute block.
It will happen this way with any working method apart from time_interval, though in that case the reason for not deadlocking is not a proper reservation but the fact that 5 minutes are usually enough to enter the depot, leave it and clear the single tracked section.
« Last Edit: July 29, 2020, 09:26:50 PM by Freahk »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20274
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Deadlocks caused by depots
« Reply #4 on: July 29, 2020, 09:18:46 PM »
There are no special circumstances. Just make sure multiple vehicles in a row are entering and leaving a depot, for examply by using the "replace" feature.

You refer to multiple vehicles - is this a necessary element of the reported issue of vehicles not reserving the depot tile? My tests so far have just been to check whether rail vehicles in the drive by sight working method actually reserve the depot tile by using the reservation display. That shows that they do reserve the depot tile. There is no reason to use multiple vehicles at once for such a test unless somehow the question of whether rail vehicles reserve the depot tile is influenced by other vehicles in some way, but, if so, I do not have a clear understanding from your description of the nature of this influence, as would be necessary for me to create a reproduction case for this, as would be necessary if I were to try to investigate this further.

Offline Freahk

  • Devotee
  • *
  • Posts: 1324
  • Languages: DE, EN
Re: Deadlocks caused by depots
« Reply #5 on: July 29, 2020, 09:28:06 PM »
See the attached saves, I've edited while you was typing this.
Vehicles seem to reserve the way correctly if it's free but ignore that tile if it's occupied, causing a deadlock.

Further investigating this, it seems the reservations is done properly but the train spawning in the depot will override it on the depot tile, so the train entering the depot won't be able to access that last tile.

A posible, rather simple solution should be to spawn trains in a depot without a reservation at all.