Skip to content

Close the session#1686

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:fix-1672
Feb 11, 2026
Merged

Close the session#1686
dgageot merged 1 commit intodocker:mainfrom
dgageot:fix-1672

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Feb 10, 2026

Fix #1671
Fix #1672

@dgageot dgageot requested a review from a team as a code owner February 10, 2026 18:33
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Found one minor inconsistency in error handling between the two cleanup approaches. The api.go command silently ignores Close() errors while run.go properly logs them. This is a low-severity code quality issue that could make debugging resource cleanup problems more difficult.

The overall approach of adding Close() methods to properly clean up session store resources is solid and addresses the resource leak issues mentioned in #1671 and #1672.

cmd/root/api.go Outdated
if err != nil {
return fmt.Errorf("creating session store: %w", err)
}
defer sessionStore.Close()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing error handling for sessionStore.Close()

The defer statement ignores any error returned by Close(). This is inconsistent with the error handling pattern in cmd/root/run.go (lines 243-245) where rt.Close() errors are logged.

Consider handling the error to aid debugging:

defer func() {
    if err := sessionStore.Close(); err != nil {
        slog.Error("Failed to close session store", "error", err)
    }
}()

While this won't cause runtime failures, it could hide important resource cleanup errors during debugging.

Fixes docker#1672
Fixes docker#1671

Assisted-By: cagent
@dgageot dgageot merged commit 4284053 into docker:main Feb 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] SQLite session store not closed in API server [bug] SQLite session store not closed

2 participants