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

Reduce errors on filebeat syslog stop #8347

Merged
merged 3 commits into from
Sep 20, 2018

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Sep 18, 2018

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"}

@ph
Copy link
Contributor

ph commented Sep 18, 2018

@jsoriano Maybe add a changelog entry?

@ph ph added the needs_backport PR is waiting to be backported to other branches. label Sep 18, 2018
@jsoriano
Copy link
Member Author

Changelog entry added

@jsoriano
Copy link
Member Author

jenkins, test this again please

@jsoriano jsoriano merged commit 9b27040 into elastic:master Sep 20, 2018
@jsoriano jsoriano deleted the filebeat-syslog-stop branch September 20, 2018 11:58
jsoriano added a commit to jsoriano/beats that referenced this pull request Sep 20, 2018
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 added v6.5.0 and removed needs_backport PR is waiting to be backported to other branches. labels Sep 20, 2018
jsoriano added a commit to jsoriano/beats that referenced this pull request Sep 20, 2018
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 added a commit that referenced this pull request Sep 24, 2018
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 added a commit that referenced this pull request Oct 16, 2018
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)
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.

2 participants