pool: Update token expiration check in cache #234

Merged
alexvanin merged 1 commit from mbiryukova/frostfs-sdk-go:bugfix/token_expiration into master 2024-07-08 08:56:04 +00:00
Member

Signed-off-by: Marina Biryukova m.biryukova@yadro.com

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2024-07-05 09:35:52 +00:00
mbiryukova force-pushed bugfix/token_expiration from 7714c7fdf8 to 560cbbd1f1 2024-07-05 09:36:38 +00:00 Compare
mbiryukova requested review from storage-core-committers 2024-07-05 09:45:44 +00:00
mbiryukova requested review from storage-core-developers 2024-07-05 09:45:45 +00:00
mbiryukova requested review from storage-sdk-committers 2024-07-05 09:45:45 +00:00
mbiryukova requested review from storage-sdk-developers 2024-07-05 09:45:47 +00:00
mbiryukova requested review from storage-services-committers 2024-07-05 09:45:49 +00:00
mbiryukova requested review from storage-services-developers 2024-07-05 09:45:52 +00:00
dstepanov-yadro reviewed 2024-07-05 10:42:05 +00:00
@ -68,3 +69,2 @@
epoch := c.currentEpoch.Load()
// use epoch+1 (clear cache beforehand) to prevent 'expired session token' error right after epoch tick
return val.token.ExpiredAt(epoch + 1)
preExpiredDur := c.tokenDuration / 2

I don't understand. If the lifetime of the session token in the cache is 10 epochs, then why will it be removed from the cache at epoch 95, and not 100?

I don't understand. If the lifetime of the session token in the cache is 10 epochs, then why will it be removed from the cache at epoch 95, and not 100?
Author
Member

To avoid errors if epoch increases between sending request to storage and its processing (which can occur now)
cc @alexvanin

To avoid errors if epoch increases between sending request to storage and its processing (which can occur now) cc @alexvanin
dkirillov approved these changes 2024-07-05 12:01:27 +00:00
fyrchik approved these changes 2024-07-05 14:04:04 +00:00
acid-ant approved these changes 2024-07-08 08:45:47 +00:00
alexvanin approved these changes 2024-07-08 08:55:23 +00:00
alexvanin merged commit 560cbbd1f1 into master 2024-07-08 08:56:04 +00:00
alexvanin deleted branch bugfix/token_expiration 2024-07-08 08:56:59 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-sdk-developers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-sdk-go#234
No description provided.