Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing eventHandler to StatsDTCPListener #235

Merged
merged 1 commit into from
Jun 14, 2019

Conversation

seruman
Copy link
Contributor

@seruman seruman commented Jun 14, 2019

When sending data with TCP exporter was panicking.

echo "foo_bar:1|c" | nc localhost 9125
INFO[0000] Starting StatsD -> Prometheus Exporter (version=, branch=, revision=)  source="main.go:168"
INFO[0000] Build context (go=go1.12.4, user=, date=)     source="main.go:169"
INFO[0000] Accepting StatsD Traffic: UDP :9125, TCP :9125, Unixgram   source="main.go:170"
INFO[0000] Accepting Prometheus Requests on :9102        source="main.go:171"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1491d98]

goroutine 14 [running]:
main.(*StatsDTCPListener).handleConn(0xc000146ac0, 0xc000010048)
	/Users/selman/src/statsd_exporter/exporter.go:514 +0x208
created by main.(*StatsDTCPListener).Listen
	/Users/selman/src/statsd_exporter/exporter.go:489 +0x4a

In tests eventHandler was set for both listeners;

l.SetEventHandler(&unbufferedEventHandler{c: events})

but not in main.go;
tl := &StatsDTCPListener{conn: tconn}

Signed-off-by: Selman Kayrancioglu <selman@peak.com>
@matthiasr
Copy link
Contributor

Good catch, thank you!

@matthiasr matthiasr merged commit bb448be into prometheus:master Jun 14, 2019
matthiasr pushed a commit that referenced this pull request Jun 14, 2019
matthiasr pushed a commit that referenced this pull request Jun 14, 2019
* Update changelog for #235
* Release 0.11.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants