pub struct RefreshLocks { /* private fields */ }Expand description
Per-subject refresh locks.
Two concurrent refreshes of one session both present the same single-use
refresh token; the loser gets invalid_grant, and most authorization servers
revoke the winner’s freshly issued tokens along with it. The symptom is
random, unreproducible logouts. The scheduler plus a single user request is
already enough concurrency to hit this.
In-process only. A second process — the invite bot, a rolling deploy —
is not covered, which is why the refresh path also re-reads the stored
session on invalid_grant before concluding the grant is dead.
Implementations§
Source§impl RefreshLocks
impl RefreshLocks
Sourcepub async fn lock(&self, sub: &str) -> OwnedMutexGuard<()>
pub async fn lock(&self, sub: &str) -> OwnedMutexGuard<()>
Acquire the lock for one subject. Unrelated subjects never contend.
Trait Implementations§
Source§impl Clone for RefreshLocks
impl Clone for RefreshLocks
Auto Trait Implementations§
impl Freeze for RefreshLocks
impl RefUnwindSafe for RefreshLocks
impl Send for RefreshLocks
impl Sync for RefreshLocks
impl Unpin for RefreshLocks
impl UnsafeUnpin for RefreshLocks
impl UnwindSafe for RefreshLocks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more