Skip to content

Commit

Permalink
More debug
Browse files Browse the repository at this point in the history
  • Loading branch information
arjan-bal committed Jan 21, 2025
1 parent afc2b13 commit 705f09e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mem/buffers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"runtime/debug"
"sync"
"sync/atomic"
"time"
)

// A Buffer represents a reference counted piece of data (in bytes) that can be
Expand Down Expand Up @@ -143,7 +144,7 @@ func (b *buffer) ReadOnlyData() []byte {
}

func (b *buffer) Ref() {
b.refCallers = append(b.refCallers, fmt.Sprintf("Count: %d, %s", b.refs.Load(), string(debug.Stack())))
b.refCallers = append(b.refCallers, fmt.Sprintf("Count: %d, time: %s, %s", time.Now(), b.refs.Load(), string(debug.Stack())))

Check failure on line 147 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (vet, 1.22)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 147 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 147 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23, -race)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 147 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23, 386)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 147 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23, arm64)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 147 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.22)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 147 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23, -race, GRPC_EXPERIMENTAL_ENABLE_NEW_PICK_FIRST=true)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time
if b.refs == nil {
panic("Cannot ref freed buffer")
}
Expand All @@ -155,7 +156,7 @@ func (b *buffer) Track() {
}

func (b *buffer) Free() {
b.freeCallers = append(b.freeCallers, fmt.Sprintf("Count: %d, %s", b.refs.Load(), string(debug.Stack())))
b.freeCallers = append(b.freeCallers, fmt.Sprintf("Count: %d, time: %q, %s", time.Now(), b.refs.Load(), string(debug.Stack())))

Check failure on line 159 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (vet, 1.22)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 159 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 159 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23, -race)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 159 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23, 386)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 159 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23, arm64)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 159 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.22)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time

Check failure on line 159 in mem/buffers.go

View workflow job for this annotation

GitHub Actions / tests (tests, 1.23, -race, GRPC_EXPERIMENTAL_ENABLE_NEW_PICK_FIRST=true)

fmt.Sprintf format %d has arg time.Now() of wrong type time.Time
if b.refs == nil {
panic("Cannot free freed buffer")
}
Expand Down Expand Up @@ -205,6 +206,7 @@ func (b *buffer) split(n int) (Buffer, Buffer) {
split.origData = b.origData
split.data = b.data[n:]
split.refs = b.refs
split.refCallers = append([]string{"split"}, b.refCallers...)
split.pool = b.pool

b.data = b.data[:n]
Expand Down

0 comments on commit 705f09e

Please sign in to comment.