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

Enhancement: Session Error handling and caching #26

Merged
merged 23 commits into from
Mar 30, 2024

Conversation

nodiesBlade
Copy link
Collaborator

@nodiesBlade nodiesBlade commented Mar 28, 2024

Github issue

N/A

Description

Occasionally during session rollover, dispatcher nodes will be syncing up to the latest session. During this time, gateway server would request for a specific sesssion, however the dispatcher (due to Pocket core code) will return the old session. This is an issue because Gateway server caches sessions, under the assumption that when requesting a specific session, then the dispatcher will return the proper session.

Example:

  1. Blockchain progresses to block 14001
  2. Dispatcher reports latest height as 14001
  3. Gateway operator sends a request for new sessions for block 14001
  4. Dispatcher returns sessions from 13997
  5. Gateway operator caches incorrect sessions.

In order to fix this, we add a explicit error check that compares the requested session with the returned session. If there is a mismatch, we return an error in our basic_client implementation.

Other misc changes:

  • Add manual cache cleaner for sessions and node cache
  • Proper fallback to env variable for altruist
  • Expose P90 Latency to qos nodes

Type of change

Please delete option that is not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Related PRs

List related PRs below

branch PR
other_pr link

@nodiesBlade nodiesBlade changed the title Enhancement/unassigned/get session improvement Enhancement: Session Error handling and caching Mar 28, 2024
@nodiesBlade nodiesBlade merged commit 2d3605a into main Mar 30, 2024
2 checks passed
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