Skip to content

Cherry-pick #8347 to 6.x: Reduce errors on filebeat syslog stop#8376

Merged
jsoriano merged 2 commits intoelastic:6.xfrom
jsoriano:backport_8347_6.x
Oct 16, 2018
Merged

Cherry-pick #8347 to 6.x: Reduce errors on filebeat syslog stop#8376
jsoriano merged 2 commits intoelastic:6.xfrom
jsoriano:backport_8347_6.x

Conversation

@jsoriano
Copy link
Copy Markdown
Member

Cherry-pick of PR #8347 to 6.x 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)
@ruflin
Copy link
Copy Markdown
Contributor

ruflin commented Sep 28, 2018

Needs a rebase.

@jsoriano
Copy link
Copy Markdown
Member Author

jsoriano commented Oct 1, 2018

Changelog line was already merged in #8433

Copy link
Copy Markdown
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WFG

@jsoriano jsoriano merged commit f6b3759 into elastic:6.x Oct 16, 2018
@jsoriano jsoriano deleted the backport_8347_6.x branch October 16, 2018 14:55
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