{"record":{"id":"52a5a92bb030c372","repo":"dagger/dagger","slug":"release-session-q-w","errorCode":null,"errorMessage":"release session %q: %w","messagePattern":"release session %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dagql/cache.go","lineNumber":1072,"sourceCode":"\tshared.ownerSessionCount++\n\treturn nil\n}\n\n// ReleaseSession marks a session dead immediately. Its return means cleanup is\n// complete or irrevocably assigned to the last active cache operation; cleanup\n// hooks may therefore run later on that operation's goroutine. Every cleanup\n// error is accumulated for Cache.Close; deferred errors are also logged on the\n// goroutine that observes them because ReleaseSession has already returned.\nfunc (c *Cache) ReleaseSession(ctx context.Context, sessionID string) error {\n\tif sessionID == \"\" {\n\t\treturn fmt.Errorf(\"release session: empty session ID\")\n\t}\n\tif c == nil {\n\t\treturn nil\n\t}\n\top, err := c.beginCacheOperation()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"release session %q: %w\", sessionID, err)\n\t}\n\tdefer op.finish(false)\n\n\tstate := c.sessionLifecycle(sessionID)\n\tstate.releaseMu.Lock()\n\toldLifecycle, newlyReleased := c.markSessionReleased(state)\n\tif !newlyReleased {\n\t\tstate.releaseMu.Unlock()\n\t\treturn nil\n\t}\n\n\tc.sessionMu.Lock()\n\tresultIDs := maps.Clone(c.sessionResultIDsBySession[sessionID])\n\tarbitraryCallKeys := maps.Clone(c.sessionArbitraryCallKeysBySession[sessionID])\n\tc.sessionMu.Unlock()\n\tstate.releasePlan = &cacheSessionReleasePlan{\n\t\tctx:               context.WithoutCancel(ctx),\n\t\tsessionID:         sessionID,","sourceCodeStart":1054,"sourceCodeEnd":1090,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/dagql/cache.go#L1054-L1090","documentation":"ReleaseSession failed while performing session teardown: the %q names the session and the wrapped error comes from the release/cleanup path (e.g. persisting session edges or running cleanup hooks). The session lifecycle flag is still flipped, but cleanup could not complete, and the error is surfaced so callers know teardown was incomplete.","triggerScenarios":"Thrown at dagql/cache.go:1072 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}