Skip to content

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

Merged
flaktack merged 7 commits into
opentripplanner:dev-2.xfrom
realCity:feature/transfer-cache
Mar 31, 2023
Merged

flaktack merged 7 commits into
opentripplanner:dev-2.xfrom
realCity:feature/transfer-cache

Conversation

@flaktack

@flaktack flaktack commented Mar 17, 2023 •

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Mar 17, 2023 •

Copy link
Copy Markdown

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.

@flaktack
flaktack force-pushed the feature/transfer-cache branch from 5aa48c8 to a73a5c1 Compare March 21, 2023 11:16
@t2gran t2gran added this to the 2.3 milestone Mar 22, 2023
@flaktack
flaktack force-pushed the feature/transfer-cache branch from a73a5c1 to 6e0b3c4 Compare March 24, 2023 08:27
@flaktack flaktack added the +Config Change This PR might require the configuration to be updated. label Mar 24, 2023
This is required for transferCacheRequest items to use routingDefaults.
@flaktack
flaktack force-pushed the feature/transfer-cache branch from 6e0b3c4 to a95253a Compare March 24, 2023 09:44
@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
Copy Markdown
Member

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

@leonardehrenfried

Copy link
Copy Markdown
Member

Can you please resolve the conflicts?

"streetRoutingTimeout": "5s",
"routingDefaults": {
"walkSpeed": 1.3,
"walkSpeed": 1.33,

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

t2gran commented Mar 28, 2023

Copy link
Copy Markdown
Member

@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
Comment thread src/test/java/org/opentripplanner/generate/doc/framework/SkipNodes.java Outdated
@flaktack
flaktack merged commit dc03652 into opentripplanner:dev-2.x Mar 31, 2023
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

Labels

+Config Change This PR might require the configuration to be updated.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initialize RAPTOR stop-to-stop transfers on server startup

4 participants