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

Improved fallback expiry #5

Open
wants to merge 2 commits into
base: v3
Choose a base branch
from

Conversation

traines-source
Copy link

@traines-source traines-source commented Jan 10, 2025

Resolving the "todo: fall back to tU.trip.start_{date,time} + buffer if available? – handle canceled trips without sTUs!".

I think it is imperative to have very long ttls for cancelled trips, since these are in some way the most important realtime updates and they might be known longer beforehand, i.e. the fallback based on getNow() when no start_time is available (which is usually not available) is dangerous. Correct me if I'm wrong, but in the current impl, cancelled trips are basically never ending up in the output feed, or more precisely only for 5 min/the ttl. Unless they are usually coming repeatedly in the DIFFERENTIAL input? (Your VBB feed does have astoundingly few/no cancelled trips when I checked.)

Another note: Depending on how you generate the input ndjson, sTU.arrival.time may never be an integer, at least when generating it with print-gtfs-rt-cli, because then it looks like "time":{"low":1736496420,"high":0,"unsigned":false}. And for feeds using relative delay instead of time, the fallback with the fallbackTripDuration will also always be used, so it also needs to be very long (maybe 6 hours is still too short). I have not found any hint in the draft standard on how to handle this.

From my experience in the last days, a ttl of 6 hours still only uses a couple of hundred MB of RAM even for big feeds like DELFI.

Since I fiddled around quite a bit with that, I have also added an example to read input from other processes via a named pipe and write the full feed to disk on every update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant