dagger/dagger · error

release session %q: %w

Error message

release session %q: %w

What it means

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.

Source

Thrown at dagql/cache.go:1072

	shared.ownerSessionCount++
	return nil
}

// ReleaseSession marks a session dead immediately. Its return means cleanup is
// complete or irrevocably assigned to the last active cache operation; cleanup
// hooks may therefore run later on that operation's goroutine. Every cleanup
// error is accumulated for Cache.Close; deferred errors are also logged on the
// goroutine that observes them because ReleaseSession has already returned.
func (c *Cache) ReleaseSession(ctx context.Context, sessionID string) error {
	if sessionID == "" {
		return fmt.Errorf("release session: empty session ID")
	}
	if c == nil {
		return nil
	}
	op, err := c.beginCacheOperation()
	if err != nil {
		return fmt.Errorf("release session %q: %w", sessionID, err)
	}
	defer op.finish(false)

	state := c.sessionLifecycle(sessionID)
	state.releaseMu.Lock()
	oldLifecycle, newlyReleased := c.markSessionReleased(state)
	if !newlyReleased {
		state.releaseMu.Unlock()
		return nil
	}

	c.sessionMu.Lock()
	resultIDs := maps.Clone(c.sessionResultIDsBySession[sessionID])
	arbitraryCallKeys := maps.Clone(c.sessionArbitraryCallKeysBySession[sessionID])
	c.sessionMu.Unlock()
	state.releasePlan = &cacheSessionReleasePlan{
		ctx:               context.WithoutCancel(ctx),
		sessionID:         sessionID,

View on GitHub (pinned to 82ba2681db)

When it happens

Trigger: Thrown at dagql/cache.go:1072 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/52a5a92bb030c372. Report an issue: GitHub.