encoded.Reader() returns a reader that should be closed, but it is never closed here.…
Jump to turn (7)
- 1encoded.Reader() returns a reader that should be closed, but it is never closed
- 2Ignore the lint error below: [lint:go] cmd/entire/cli/checkpoint/committed.go:16
- 3No, make the linter ignore that issue - e.g. add an exception
- 4No, make the linter ignore that issue - e.g. add an exception
- 5strategy.createCommit is a line-for-line duplicate of checkpoint.CreateCommit (w
- 6/exit exit
- 7On the main.go changes to register the objectsigner, let's move that to Persiste
- User
encoded.Reader() returns a reader that should be closed, but it is never closed here. This can leak resources across repeated checkpoint commits. Close the reader after signer.Sign completes (typically with defer r.Close() after the successful Reader() call).
SignCommitBestEffort calls settings.IsSignCheckpointCommitsEnabled(ctx), which reloads settings from disk each time a commit is created. Since checkpoint creation can be frequent, this adds avoidable overhead. Consider loading this setting once (per command/run/store) and passing the resolved boolean into signing, or caching the loaded settings.
New signing behavior is introduced here, but there are no tests verifying: (1) signatures are added when an ObjectSigner is registered and settings allow it, (2) signing is skipped when sign_checkpoint_commits=false, and (3) errors from the signer are best-effort (commit remains unsigned and a warning is logged). Adding unit tests with a stub plugin.ObjectSigner() would help prevent regressions.
Assistant· claude-opus-4-6