TL;DR
Trains can get into a permanently waiting situation which is fairly easy to path out of with existing rules tweaked.What ? #1
1) When pathfinding inside a chain signal sequence, the train's currently occupied block should not be discounted from consideration due to being reserved.However in the following situation, the train does not find the valid path through (A) + (B):0.17.38:
When a train performs path finding while in a chain signal sequence, the pathfinding will have a constraint to not go through reserved block before exiting the chain sequence. This solves a problem of train intersections being possible to be deadlocked even with proper chain signals usage in cases of using temporary stops or when path is changed because of station is being enabled/disabled by a circuit network. This also allowed us to to let train recalculate path spontaneously even in chain signal sequence, as it shouldn't break anything now.
It seems that the vertical slice of track may be getting ignored because it is reserved by a train (the train doing the pathing).
Ideal path not passing through parked train, which allows immediate departure:
What ? #2
2)The time based penalty should include trains waiting at a stop in addition to trains waiting at a rail signal.When the rail block contains a train currently waiting at a rail signal -> Add a penalty of 100 + 0.1 for every tick the train has already waited.
If this time based penalty was applied to the train currently waiting at stop (C), then the pathing train would eventually go around and prioritize the 180 turn to escape.
By my math, this would take (1500-100) / .1 / 60 = 3.9 minutes to overcome the single extra unoccupied stop penalty.
Testing Notes:
After 10 minutes of waiting, the train did not repath through (A) + (B) while the blocking trains waited at the stops (C).
When all three parked trains were advanced to the signals via temporary stop orders, only then did the stuck train escape, after an additional ~4 minutes of waiting as expected.
If the time penalty accounted for trains at stops and not just at signals, then the stuck train would have been able to escape the original situation eventually.
In common situations, I expect the escape would also be prompt, since the train at the stop will either leave frequently and allow escape, or have been parked for many minutes before the stuck train started trying to escape and already have a sufficient pathing penalty built up.