Skip to content

Commit

Permalink
dont log osq db lock when using debugger (kolide#2021)
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Pickett authored Jan 2, 2025
1 parent 97f4ab0 commit 888a2d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ee/log/osquerylogs/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ func getSliceStat(getFunc func() ([]int32, error)) string {

// logInfoAboutProcessHoldingLockfile logs information about the osquery database's lock file.
func (l *OsqueryLogAdapter) logInfoAboutProcessHoldingLockfile(ctx context.Context, p []byte) {
executable, err := os.Executable()
if err == nil && strings.Contains(executable, "__debug_bin") {
return
}

matches := lockfileRegex.FindAllStringSubmatch(string(p), -1)
if len(matches) < 1 || len(matches[0]) < 2 {
l.slogger.Log(context.TODO(), slog.LevelError,
Expand Down

0 comments on commit 888a2d0

Please sign in to comment.