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

Cherry-pick #8347 to 6.4: Reduce errors on filebeat syslog stop #8377

Merged
merged 1 commit into from Sep 24, 2018

Conversation

jsoriano
Copy link
Member

Cherry-pick of PR #8347 to 6.4 branch. Original message:

Fix a couple of errors seen when syslog input is stopped.

In case the input couldn't be started (e.g. port was already in use), there was a nil pointer reference when trying to stop it:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x12facac]

goroutine 81 [running]:
github.com/elastic/beats/filebeat/inputsource/udp.(*Server).Stop(0xc42008a100)
	/go/src/github.com/elastic/beats/filebeat/inputsource/udp/server.go:118 +0x7c
github.com/elastic/beats/filebeat/input/syslog.(*Input).Stop(0xc42008a140)
	/go/src/github.com/elastic/beats/filebeat/input/syslog/input.go:189 +0xeb
github.com/elastic/beats/filebeat/input.(*Runner).stop(0xc42025e2a0)
	/go/src/github.com/elastic/beats/filebeat/input/input.go:173 +0xcd
github.com/elastic/beats/filebeat/input.(*Runner).Start.func1.1(0xc420277410, 0xc42025e2a0)
	/go/src/github.com/elastic/beats/filebeat/input/input.go:128 +0x39
github.com/elastic/beats/filebeat/input.(*Runner).Start.func1(0xc420277410, 0xc42025e2a0)
	/go/src/github.com/elastic/beats/filebeat/input/input.go:133 +0x5c
created by github.com/elastic/beats/filebeat/input.(*Runner).Start
	/go/src/github.com/elastic/beats/filebeat/input/input.go:125 +0x16e

In any case, on stop, this error was logged lots of times:

2018-09-18T17:37:42.818Z	ERROR	[udp]	udp/server.go:99	Error reading from the socket *net.OpError read udp 127.0.0.1:9000: use of closed network connection	{"address": "localhost:9000"}

Fix a couple of errors seen when syslog input is stopped.

In case the input couldn't be started (e.g. port was already in use),
there was a nil pointer reference error when trying to stop it.

In any case, on stop, an error about use of closed connection was logged
lots of times:

(cherry picked from commit 9b27040)
@jsoriano jsoriano merged commit 15d4139 into elastic:6.4 Sep 24, 2018
@jsoriano jsoriano deleted the backport_8347_6.4 branch September 24, 2018 20:52
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Fix a couple of errors seen when syslog input is stopped.

In case the input couldn't be started (e.g. port was already in use),
there was a nil pointer reference error when trying to stop it.

In any case, on stop, an error about use of closed connection was logged
lots of times.

(cherry picked from commit e39ae43)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants