The International Simutrans Forum

 

Author Topic: [BUG] one_train_staff greedily reservating tiles it can not yet enter  (Read 307 times)

0 Members and 1 Guest are viewing this topic.

Online Freahk

  • Devotee
  • *
  • Posts: 1257
  • Languages: DE, EN
What happened?
When a train is waiting at a cabinet, it will greedily start reservating tiles even if it can't enter the section yet.

How to reproduce?
- Open the attached reproduction case
- You will see a train being in a one_train_staff controlled section and another one waiting at the cabinet for clearance.
- Clear the reservation of the train in one train staff controlled section.

Observations:
- The train whose resevation was just cleared will continue in drive_by_sight, as expected.
- The other train will greedily reservate any tile as soon as it gets cleared by the train in the section.
- The train in the section will reverse at the dead-end.
- After reversal it can't continue because the way is already reservated
- Deadlock

Note that this won't happen quite often but it will be a hassle either spamming the clear-reservation tool or opening the schedule of the train at the cabinet , then clearing the reservation and closing the schedule when the train left the section.
Especially when the train at the cabinet is not your own whilst the stuck one is, this will be quite annoying.
When the train in the section already reports "stuck", spamming the reservation tool won't help at all because the train at the cabinet will always create its reservation faster than the one in drive_by_sight, so this will either require help of the server administration or the player who is waiting at the cabinet.

Also see one_train_staff clearing too many tiles, where this behavior is involved in deadlocking a proper one_train_staff layout.

Further, this might affect some strange mixes in between one_train_staff and any other signalling system but that should not be a problem imho. I can't imagine any combination that might be expected working and will unexpectedly deadlock at some time in the future.


I guess I finally have reported any one_train_staff related bugs I know of.
« Last Edit: January 20, 2020, 03:50:56 PM by Freahk »

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 20207
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG] one_train_staff greedily reservating tiles it can not yet enter
« Reply #1 on: January 19, 2020, 05:12:55 PM »
Thank you for the report: I believe that I have now fixed this. I should be grateful if you could re-test with the next nightly build.

Online Freahk

  • Devotee
  • *
  • Posts: 1257
  • Languages: DE, EN
Re: [BUG] one_train_staff greedily reservating tiles it can not yet enter
« Reply #2 on: January 20, 2020, 03:12:02 PM »
Fixed.

The train leaving the section will enter one_train_staff when leaving the section, but that's an issue by design as cabinets cannot know if they are the entry point for the section or the exit apart from infering this from trains working method.

Edit: Maybe they can. If the next cabinet on the route is not adjacent (the exploit fix), we know for sure that either trains working method or the signalling layout was wrong, thus passing in drive_by_sight
« Last Edit: January 21, 2020, 10:46:02 AM by Freahk »