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

Caches are not updated immediately after feed subscription #581

Open
hbruch opened this issue Nov 27, 2024 · 0 comments
Open

Caches are not updated immediately after feed subscription #581

hbruch opened this issue Nov 27, 2024 · 0 comments
Assignees

Comments

@hbruch
Copy link
Collaborator

hbruch commented Nov 27, 2024

Expected behavior

After a feed has been subscribed successfully, not only it's validations metrics should be up-to-date, but also all caches should be updated.

Observed behavior

Update and subscription are currently done in separate threads. It may happen, that an update for all subscriptions is performed before all feeds are successfully registered. Feeds registered after this run are only updated org.entur.lamassu.feedupdateinterval seconds later.

This behavior does not cause greater issues when feeds are updated in short intervals, as usually the case. However, if org.entur.lamassu.feedupdateinterval is set to a high value, this causes issues.
(We update test system feeds only every n hours to avoid hitting rate limits for some providers for which we only have a single set of credentials we use for prod and test). In such a scenario, the first update may only happen after n hours, if the registration is successful only after the first update was performed.

Version of lamassu used (exact commit hash or JAR name)

8129a3a

Data sets in use (links to GBFS feeds)

/

Command line used to start lamassu

Configuration used

org.entur.lamassu.feedupdateinterval=86400

Steps to reproduce the problem

  • configure a couple of feeds
  • set org.entur.lamassu.feedupdateinterval to e.g. 86400
  • start lamassu
  • check if all feeds can be retrieved from lamassu. Some migh return http code 502 instead of 200, as they are registered after the first update happened.
  • (Note: this can be provoked manually, by blocking access to one of the feeds for a few minutes, so lamassu's update happens before the feed is available)

Suggested fix

This issue should be avoided by letting FeedUpdater call GbfsSubscriptionManager.update(subcriptionId) for a newly registered subscription immediately. This method was introduced with entur/gbfs-loader-java#194.

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

No branches or pull requests

2 participants