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

[BUG] Cache may silently cause bad data to be returned close to current day #3

Open
dblock opened this issue Oct 13, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@dblock
Copy link
Member

dblock commented Oct 13, 2022

What is the bug?

The cache implementation forces a cache hit via https://github.com/opensearch-project/project-tools/blob/main/lib/faraday/cache_control.rb as long as the URL is the same. This is because historical data rarely changes and making page long requests for old issues or PRs is typically wasteful. Users can always specify --no-cache to get fresh data.

For recent data, such as the last PRs or issues, the data changes often. Therefore re-running the tool a few days later will quietly and unexpectedly return stale data.

How can one reproduce the bug?

  1. Run ./bin/project prs stats --from=2022-01-01 --to=2022-XX-YY on Monday with XX and YY being Monday.
  2. Run it again on Thursday with XX-YY being Thursday.
  3. Observe identical results to Monday's.

What is the expected behavior?

In the example above data for this week should have been refreshed.

Do you have any additional context?

A probably fix is to set cache expiration to minutes/hours for recent data explicitly, or always fetch data that belongs to new dates without cache.

@dblock dblock added the bug Something isn't working label Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant