Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the auto-router path timeout check to an inner loop #11259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ollybh
Copy link
Collaborator

@ollybh ollybh commented Oct 6, 2024

Implementation Notes

Explanation of Change

The auto-router's path timeout is supposed to stop too much time being spent on building up the set of possible routes for trains. It was being checked once in each iteration of possible starting nodes for routes.

However, in particularly degenerate cases this meant that far too long was elapsing between timeout checks: issue #11252 had more than ten hours pass before the first and second timeout checks.

This moves the timeout check to an inner loop, so it is checked more frequently.

Fixes #11252.

Any Assumptions / Hacks

This uses a custom error class to break out of the loop if too long has elapsed. There are other ways that this could be done, I'm not sure if this is the best.

Before clicking "Create"

  • Branch is derived from the latest master
  • Add the pins or archive_alpha_games label if this change will break existing games
  • Code passes linter with docker compose exec rack rubocop -a
  • Tests pass cleanly with docker compose exec rack rake

@ollybh ollybh added the autorouting Issues relating to autorouting label Oct 6, 2024
@ollybh ollybh requested a review from michaeljb October 6, 2024 18:06
The auto-router's path timeout is supposed to stop too much time being
spent on building up the set of possible routes for trains. It was being
checked once in each iteration of possible starting nodes for routes.

However, in particularly degenerate cases this meant that far too long
was elapsing between timeout checks: issue tobymao#11252 had more than
ten hours pass before the first and second timeout checks.

This moves the timeout check to an inner loop, so it is checked more
frequently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autorouting Issues relating to autorouting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autorouter taking too long to time out
1 participant