Skip to content

fix: expensive sorting of token list. - #218

Merged
thenav56 merged 1 commit into
IFRCGo:developfrom
pantierra:fix/token-auth-sorting
Sep 4, 2026
Merged

fix: expensive sorting of token list.#218
thenav56 merged 1 commit into
IFRCGo:developfrom
pantierra:fix/token-auth-sorting

Conversation

@pantierra

Copy link
Copy Markdown
Collaborator

Every request to the API needs to check "is this person's login token still valid?" To avoid asking that question over and over, the server keeps a cache with up to 50,000 answers.

Once that notebook is full, it needs to erase old answers to make room for new ones. For this, it flips through and re-sort the entire cache just to find the one answer to erase. Every single time.

Instead of "sort everything, then grab the one you need," let's use a heap stack. That should be more performant.

@wrynearson

Copy link
Copy Markdown
Collaborator

@thenav56 if you're still around, could you review and merge (to staging)?

@thenav56
thenav56 merged commit 29b11e6 into IFRCGo:develop Sep 4, 2026
2 of 3 checks passed
@thenav56

thenav56 commented Sep 4, 2026

Copy link
Copy Markdown
Member

Argocd is green.

The configmap didn't recreated the stac-auth pod, for now terminated the existing pod to use the latest changes.

Applied to both staging and production.

@pantierra
pantierra deleted the fix/token-auth-sorting branch September 4, 2026 11:56
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.

3 participants