Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

3.8 KB
Raw Blame

Server-side login sessions are now bound to the database's durable rekey epoch. A password change in any worker process ends every session issued before it on its next check. A login that proved the old password just as another worker committed a password change is refused (401) instead of receiving a session. If the epoch cannot be read, or a password change is pending, when the session is created (at login, or at the automatic sign-in after registration) or when the login's database open re-reads the epoch after verifying the password, or that re-read finds a different committed epoch (possible only when something changed the epoch file without taking the rekey lock), or that open recorded no epoch proof for the user, the response is 503 rather than a session the server cannot fence. A registration refused this way keeps the account it created, so the user can sign in once the fault clears. None of these refusals changes the account-lockout counter.

A session checked while a password change is pending (its new epoch written but not yet committed) is removed, because the durable state cannot vouch for it. This holds even when that change later fails with a retryable error and the old password keeps working: the sessions removed in the meantime stay removed, and their users sign in again.

If the epoch file cannot be read while a request is being authorized (for example file-descriptor exhaustion), every request whose session cookie names a signed-in user is refused with 503, including static files and pages that need no login, except POST /auth/logout. The session is kept, so a transient fault no longer logs every active user out. The logout endpoint itself stays available during such a fault: it ends the caller's own session and clears its cookie without opening the database. The page's logout button first checks the session by fetching a fresh CSRF token, which is refused like any other request, so during such a fault it shows a message asking the user to try again. Clearing a cookie whose database can no longer be reopened also destroys its server-side session and disconnects its sockets during such a fault.

SessionManager.has_active_sessions_for no longer counts a session whose epoch has been superseded. Only that check changed: the idle-connection sweep's snapshot of active users (get_active_usernames) is still time-based and keeps counting such a session until it idles out or its next check removes it.

When a check removes a session (its epoch was superseded, the durable epoch state cannot vouch for it, or it idled out), the live Socket.IO connections opened with that session are disconnected too. A password change ends every session of that user held by the worker process that handled it and disconnects all of that user's sockets in that process at once. When the password is changed in another worker, a socket opened with a stolen cookie is disconnected only when its session is next checked (an HTTP request, a socket connect, or a subscribe/unsubscribe carrying that cookie); a socket that sends nothing keeps receiving the user's events in its own worker until that session idles out, and progress events delivered to a socket subscribed to a research keep the session from idling out. On Windows, a reader holding an epoch file open briefly blocks a password change or a new database from replacing or removing it (and the reverse); both sides now retry that sharing violation a few times before failing, and a read that still fails is refused with 503 as above.

The unused authorization-lease API (acquire_authorization_lease, AuthorizationLeaseMode) and its .rekey.authorization.lock sidecar are removed; the rekey lock is the only sidecar lock. When the backup refresh after a password change cannot take the rekey lock (#7755), that is now logged as a warning without a traceback, because the frame holds the old and new passwords.