microsoft/FASTER · error · FasterException

Unable to find session named

Error message

Unable to find session named {sessionName} to recover

What it means

ResumeSession looks up the given session name in the recovered-session map produced by checkpoint recovery. If the name is not present (or was already resumed via TryRemove), there is no persisted state to resume and FASTER throws.

Solutions

  1. Call fht.Recover() first so recovery info is loaded into _recoveredSessionNameMap, then verify the name exists.
  2. Check that the session name matches one used in a checkpointed session; create a new session if it never existed.
  3. Do not resume the same named session twice; each recovered name can only be resumed once.
  4. Catch FasterException and fall back to creating a new session.

Example fix

// before
var session = fht.ResumeSession<Functions>(functions, "worker1", out var cp); // may throw
// after
fht.Recover();
if (fht.TryRecoverSessionCheckpoint("worker1", out _))
    var session = fht.ResumeSession<Functions>(functions, "worker1", out var cp);
else
    var session = fht.NewSession<Functions>(functions);
Defensive patterns

Strategy: try-catch

Validate before calling

fht.Recover(); // load recovery info before attempting resume

Try / catch

try
{
    session = fht.ResumeSession<Functions>(functions, sessionName, out var cp);
}
catch (FasterException) when (ex.Message.Contains("Unable to find session"))
{
    session = fht.NewSession<Functions>(functions);
}

Prevention

When it happens

Trigger: Calling fht.ResumeSession(functions, "mySession", out commitPoint) when no checkpoint recovery found a session with that name, or when the session was already resumed once (TryRemove makes it single-use).

Common situations: Attempting to resume sessions without first calling fht.Recover() on a reopened instance; resuming the same named session twice; typo in session name.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of microsoft/FASTER@321d872eab (2026-09-15). Data as JSON: /api/errors/741a82003e08b3be. Report an issue: GitHub.

Appendix: source

Thrown at cs/src/core/ClientSession/FASTERClientSession.cs:223

            return ResumeSession<Input, Output, Context, IFunctions<Key, Value, Input, Output, Context>>(functions, sessionName, out commitPoint, sessionVariableLengthStructSettings, readCopyOptions);
        }

        /// <summary>
        /// Resume (continue) prior client session with FASTER, used during
        /// recovery from failure.
        /// </summary>
        /// <param name="functions">Callback functions</param>
        /// <param name="sessionName">Name of previous session to resume</param>
        /// <param name="commitPoint">Prior commit point of durability for session</param>
        /// <param name="sessionVariableLengthStructSettings">Session-specific variable-length struct settings</param>
        /// <param name="readCopyOptions"><see cref="ReadCopyOptions"/> for this session; override those specified at FasterKV level, and may be overridden on individual Read operations</param>
        /// <returns>Session instance</returns>
        internal ClientSession<Key, Value, Input, Output, Context, Functions> ResumeSession<Input, Output, Context, Functions>(Functions functions, string sessionName, out CommitPoint commitPoint,
                SessionVariableLengthStructSettings<Value, Input> sessionVariableLengthStructSettings = null, ReadCopyOptions readCopyOptions = default)
            where Functions : IFunctions<Key, Value, Input, Output, Context>
        {
            if (_recoveredSessionNameMap == null || !_recoveredSessionNameMap.TryRemove(sessionName, out int sessionID))
                throw new FasterException($"Unable to find session named {sessionName} to recover");

            return InternalResumeSession<Input, Output, Context, Functions, ClientSession<Key, Value, Input, Output, Context, Functions>>(functions, sessionID, out commitPoint,
                        ctx => new ClientSession<Key, Value, Input, Output, Context, Functions>(this, ctx, functions, sessionVariableLengthStructSettings), readCopyOptions);
        }

        /// <summary>
        /// Resume (continue) prior client session with FASTER; used during recovery from failure.
        /// For performance reasons this overload is not recommended if functions is value type (struct).
        /// </summary>
        /// <param name="functions">Callback functions</param>
        /// <param name="sessionID">ID of previous session to resume</param>
        /// <param name="commitPoint">Prior commit point of durability for session</param>
        /// <param name="sessionVariableLengthStructSettings">Session-specific variable-length struct settings</param>
        /// <param name="readCopyOptions"><see cref="ReadCopyOptions"/> for this session; override those specified at FasterKV level, and may be overridden on individual Read operations</param>
        /// <returns>Session instance</returns>
        public ClientSession<Key, Value, Input, Output, Context, IFunctions<Key, Value, Input, Output, Context>> ResumeSession<Input, Output, Context>(IFunctions<Key, Value, Input, Output, Context> functions, int sessionID,
                out CommitPoint commitPoint, SessionVariableLengthStructSettings<Value, Input> sessionVariableLengthStructSettings = null, ReadCopyOptions readCopyOptions = default)
        {

View on GitHub (pinned to 321d872eab)