HIGH: No size limit on deployment logs stored in SQLite #122
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
Deployment logs are accumulated without any size cap in the
logsTEXT column of thedeploymentstable. ThedeploymentLogWriterflushes buffered build output to the database every second viaAppendLog, which concatenates to the existing logs string.A long build (up to the 30-minute
buildTimeout) producing continuous output can generate hundreds of MB in a single row.Impact
logsvalues cause slow queries when loading deployment detailsAppendLogre-writes the entire logs column on every flush (read + concat + write), so performance degrades quadratically with log sizeFiles
internal/models/deployment.go—AppendLog()concatenates without limitinternal/service/deploy/deploy.go—deploymentLogWriterflushes every secondSuggested Fix
Options (not mutually exclusive):
AppendLogat a maximum size (e.g., 1MB) and truncate oldest lines when exceededwriteLogsToFile) and keep only a tail/summary in the DB