Skip to content

Remove service date from cache key of SiriTripPatternCache #6069

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

Merged

Conversation

leonardehrenfried
Copy link
Member

@leonardehrenfried leonardehrenfried commented Sep 17, 2024

Summary

In today's real time meeting we talked about the indexing of trip patterns in the SiriTripPatternCache and we came to the following conclusion:

  • we don't really know why the cache key contains the service date
  • even though we are uneasy about it, @vpaturet agreed to just try it out on Entur's staging system to find out if there are negative consequences

Issue

#4002

@leonardehrenfried leonardehrenfried added the Real-Time Update The issue/PR is related to RealTime updates label Sep 17, 2024
@leonardehrenfried leonardehrenfried requested a review from a team as a code owner September 17, 2024 13:08
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.24%. Comparing base (698df74) to head (c4d5fb9).
Report is 321 commits behind head on dev-2.x.

Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #6069   +/-   ##
==========================================
  Coverage      70.24%   70.24%           
- Complexity     18369    18370    +1     
==========================================
  Files           2087     2087           
  Lines          77381    77370   -11     
  Branches        7839     7837    -2     
==========================================
- Hits           54358    54351    -7     
+ Misses         20249    20245    -4     
  Partials        2774     2774           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@t2gran t2gran added this to the 2.7 (next release) milestone Sep 18, 2024
@habrahamsson-skanetrafiken habrahamsson-skanetrafiken marked this pull request as draft October 15, 2024 08:46
@t2gran t2gran modified the milestones: 2.7, 2.8 (next release) Mar 12, 2025
@leonardehrenfried leonardehrenfried marked this pull request as ready for review March 17, 2025 11:52
@leonardehrenfried
Copy link
Member Author

After a long break I'm re-opening this topic. @vpaturet has said that Entur might have the capacity to tests this.

@habrahamsson-skanetrafiken
Copy link
Contributor

We did decide to remove the date, and I think that is a good thing to do since it's hard to figure out a reason for having the date in the key.

If we wanted to improve this further, I think what would make the most sense is having the key for the TripPatterns be based on the contents of the trip patterns like:

key = new TripPatternKey(
  trip.getRoute(),
  trip.getMode(),
  trip.getNetexSubMode()
  stopPattern
  originalTripPattern
)

That way we would be sure that we wouldn't reuse an incorrect TripPattern in (very unusual) case where two unrelated trips with different routes were modified to use the same StopPattern.

What do you think about that?

@leonardehrenfried
Copy link
Member Author

We could do that but then we should do it both for GTFS and SIRI, isn't it?

@habrahamsson-skanetrafiken
Copy link
Contributor

Yeah I think we should do the same for GTFS in that case. If you want to do this smaller change first in order to unify the caches I think that's a good move in the right direction.

@miklcct
Copy link
Contributor

miklcct commented Mar 20, 2025

That way we would be sure that we wouldn't reuse an incorrect TripPattern in (very unusual) case where two unrelated trips with different routes were modified to use the same StopPattern.

This case is not unusual. It is fairly common that two bus routes share the same stop pattern, especially if one is a day route and the other is the corresponding night route.

For example, in London, the 98 and the N98 short working services share the same stop pattern, as the full length of N98 is just the 98 extended further to cover a section where the tube is not running at night.

In Hong Kong, there are 3 minibus routes (52A / 54A / 56A) which are exactly the same, because they are short working services of 3 different routes running in a common corridor, and are operationally belong to the 3 different routes instead.

@leonardehrenfried
Copy link
Member Author

We talked about this in today's meeting and we decided that we will keep the scope of the PR small so we will leave Henrik's suggestion for a follow up.

@vpaturet
Copy link
Contributor

Briefly tested with Norway real-time feeds. No visible difference.

@optionsome optionsome merged commit e7dbbf2 into opentripplanner:dev-2.x Apr 24, 2025
6 checks passed
@leonardehrenfried leonardehrenfried deleted the siri-pattern-cache branch April 24, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Real-Time Update The issue/PR is related to RealTime updates Skip Changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants