Closed algrebe closed 8 years ago
This was observed when I tried to use the same key in both PrecisionTiming and Incr using buffered client - Issue https://github.com/quipo/statsd/issues/28
The Update function in PrecisionTiming finds out that they are not of the same type and when it calls the .String() inside the fmt.Errorf
this recursion starts.
@quipo can you open this again ? I don't think it is fixed yet.
package main
import (
"fmt"
"github.com/quipo/statsd/event"
"time"
)
func main() {
st := time.Now()
time.Sleep(2 * time.Second)
duration := time.Now().Sub(st)
p := event.NewPrecisionTiming("mystat", duration)
fmt.Printf("%v", p)
}
src/github.com/algrebe/statest$ go run statest.go
runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow
runtime stack:
runtime.throw(0x50fb00, 0xe)
/usr/local/go/src/runtime/panic.go:527 +0x90
runtime.newstack()
/usr/local/go/src/runtime/stack1.go:800 +0xb17
runtime.morestack()
/usr/local/go/src/runtime/asm_amd64.s:330 +0x7f
the code in event/precisiontiming.go has the String function calling the Payload function, and the payload function returns the precision timing object - this is causing infinite recursion.