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

Initialize RAPTOR stop-to-stop transfers on server startup #4977

Merged
merged 7 commits into from Mar 31, 2023

Conversation

flaktack
Copy link
Contributor

@flaktack flaktack commented Mar 17, 2023

Summary

The runtime configuration is modified so that a list of RouteRequests may be specified to calculate stop-to-stop transfers before the server is ready to serve requests.

  1. router-config.json is extended with a new field, transferCacheRequests. The RouteRequest configured in routingDefaults is the default for the items in transferCacheRequests.
  2. the items in transferCacheRequests are used to initialize RaptorRequestTransferCache.
{
  "transit": {
    "transferCacheRequests": [
      { "modes": "WALK"                                                     },
      { "modes": "WALK",    "wheelchairAccessibility": { "enabled": true  } }
    ]
  }
}

Adding items to transferCacheRequests increases the server startup time with considerable CPU usage. If automatic scaling is configured based on CPU usage, the longer startup times should be considered.

Issue

closes #4973

Unit tests

Documentation

☑️

Changelog

☑️

Bumping the serialization version id

@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Patch coverage: 73.68% and project coverage change: +0.06 🎉

Comparison is base (6baa4b0) 64.08% compared to head (4edec8c) 64.14%.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #4977      +/-   ##
=============================================
+ Coverage      64.08%   64.14%   +0.06%     
- Complexity     13593    13621      +28     
=============================================
  Files           1676     1676              
  Lines          66288    66456     +168     
  Branches        7154     7164      +10     
=============================================
+ Hits           42480    42630     +150     
- Misses         21429    21441      +12     
- Partials        2379     2385       +6     
Impacted Files Coverage Δ
...va/org/opentripplanner/ext/siri/SiriHttpUtils.java 0.00% <0.00%> (ø)
...i/updater/SiriETGooglePubsubUpdaterParameters.java 43.75% <ø> (+2.57%) ⬆️
...r/ext/siri/updater/SiriETHttpTripUpdateSource.java 0.00% <0.00%> (ø)
...pentripplanner/ext/siri/updater/SiriETUpdater.java 0.00% <0.00%> (ø)
...t/siri/updater/azure/AbstractAzureSiriUpdater.java 0.00% <0.00%> (ø)
...ri/updater/azure/SiriAzureETUpdaterParameters.java 66.66% <ø> (ø)
...siri/updater/azure/SiriAzureUpdaterParameters.java 68.00% <ø> (ø)
...raptoradapter/transit/TransitTuningParameters.java 58.33% <0.00%> (-5.31%) ⬇️
...pplanner/updater/trip/MqttGtfsRealtimeUpdater.java 0.00% <0.00%> (ø)
...pdater/trip/MqttGtfsRealtimeUpdaterParameters.java 0.00% <ø> (ø)
... and 12 more

... and 16 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

This is required for transferCacheRequest items to use routingDefaults.
@flaktack flaktack marked this pull request as ready for review March 24, 2023 09:44
@flaktack flaktack requested a review from a team as a code owner March 24, 2023 09:44
@leonardehrenfried
Copy link
Member

@Bartosz-Kruba Since this is a feature that you're interested in, could you please review this?

@leonardehrenfried
Copy link
Member

Can you please resolve the conflicts?

@@ -2,17 +2,17 @@
"configVersion": "v2.2.0-EN000121",
"streetRoutingTimeout": "5s",
"routingDefaults": {
"walkSpeed": 1.3,
"walkSpeed": 1.33,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these configuration changes relevant to the implementation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want these changes - look at it as clen-up, not relevant, but indeed welcome.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required due to this change:

a95253a#diff-4694584dc4047e7a37434a4b1dcc131e4c40470f737bf21eb222b7180de2fdf8L61-R61

router-config.json is parsed when creating the documentation. Since the values in RouteRequest are now copied from the default request (due to using clone()) parsing transferCacheRequests modifies the stored default values for the documentation. routingDefaults was updated to the default values due to this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the changes are not needed anymore, I've removed them.

@t2gran
Copy link
Member

t2gran commented Mar 28, 2023

@flaktack can you cherry-pick this commit into this: 9376488

I have linked to the RouteRequest.md doc instead of inlining it in the Router doc.

t2gran and others added 3 commits March 29, 2023 14:40
t2gran
t2gran previously approved these changes Mar 29, 2023
@flaktack flaktack merged commit dc03652 into opentripplanner:dev-2.x Mar 31, 2023
5 checks passed
t2gran pushed a commit that referenced this pull request Mar 31, 2023
@flaktack flaktack deleted the feature/transfer-cache branch March 31, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initialize RAPTOR stop-to-stop transfers on server startup
4 participants