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

log/syslog: fails to reconnect or return error #6765

Closed
gopherbot opened this issue Nov 14, 2013 · 8 comments
Closed

log/syslog: fails to reconnect or return error #6765

gopherbot opened this issue Nov 14, 2013 · 8 comments

Comments

@gopherbot
Copy link

by phmmnd:

What steps will reproduce the problem?

1. Start a fake syslog server using openbsd netcat: nc -kl 1234
2. Run the program at http://play.golang.org/p/ADb0RmfVYI, which attempts to log a
message over syslog every second, and reports the returned error.
3. Kill the netcat session.
4. Note that the test program continues to send messages without reconnecting or
reporting any errors.

What is the expected output?

According to the docs the connection should be retried once for each log message. In any
case an error should be returned to the calling code.

What do you see instead?

No errors or reconnections.

Which compiler are you using (5g, 6g, 8g, gccgo)?

6g

Which operating system are you using?

Darwin (Mac OS X 10.7.5)

Which version are you using?  (run 'go version')

go version go1.1.1 darwin/amd64

Please provide any additional information below.

The "(w *Writer) write" method in log/syslog always returns a nil error, which
means all of the error handling and retry code in "(w *Writer) writeAndRetry"
can never be called.
@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@dsymonds
Copy link
Contributor

dsymonds commented Dec 2, 2013

Comment 2:

Labels changed: added priority-later, packagebug, removed priority-triage.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 4:

Labels changed: added repo-main.

@nightlyone
Copy link
Contributor

Comment 5:

I have a simple patch available for this problem at
Jimdo/periodicnoise@672a225
and even a very crude test available here
Jimdo/periodicnoise@c670de2
which shows the hang due to hanging listeners quite nicely.
I have this in production since about a month without any problems. Are you guys
interested in my polishing this up?
My problem in production there have been missing timeouts in the unix domain socket log
listeners.

@kelseyhightower
Copy link
Contributor

Comment 6:

I'm not able to reproduce this running on tip.
My test environment:
rsyslog (running on a separate host)
nc (running on a separate host)
go tip (changeset:   18948:94165b19719e)
Ubuntu 13.10
Using the code from http://play.golang.org/p/ADb0RmfVYI  with a slight modification to
connect to a different host running rsyslog and nc I get the following behavior:
When running rsyslog on a remote host:
go run main.go 
2014/01/27 02:41:39 sent msg: <nil>
2014/01/27 02:41:40 sent msg: <nil>
2014/01/27 02:41:41 sent msg: <nil>
2014/01/27 02:41:42 sent msg: <nil>
2014/01/27 02:41:43 sent msg: <nil>
2014/01/27 02:41:44 sent msg: <nil>
2014/01/27 02:41:45 sent msg: dial tcp 192.168.12.151:514: connection refused
2014/01/27 02:41:46 sent msg: dial tcp 192.168.12.151:514: connection refused
2014/01/27 02:41:47 sent msg: dial tcp 192.168.12.151:514: connection refused
2014/01/27 02:41:48 sent msg: dial tcp 192.168.12.151:514: connection refused
2014/01/27 02:41:49 sent msg: dial tcp 192.168.12.151:514: connection refused
2014/01/27 02:41:50 sent msg: dial tcp 192.168.12.151:514: connection refused
2014/01/27 02:41:51 sent msg: dial tcp 192.168.12.151:514: connection refused
2014/01/27 02:41:52 sent msg: <nil>
2014/01/27 02:41:53 sent msg: <nil>
2014/01/27 02:41:54 sent msg: <nil>
2014/01/27 02:41:55 sent msg: <nil>
2014/01/27 02:41:56 sent msg: <nil>
2014/01/27 02:41:57 sent msg: dial tcp 192.168.12.151:514: connection refused
2014/01/27 02:41:58 sent msg: dial tcp 192.168.12.151:514: connection refused
2014/01/27 02:41:59 sent msg: dial tcp 192.168.12.151:514: connection refused
Starting and stopping the rsyslog server results in the expected behavior -- errors are
generated when rsyslog is down and the connection is restored  when rsyslog is restarted.
I get the exact same results against the a remote host running nc -ls 514.

@gopherbot
Copy link
Author

Comment 7 by phmmnd:

I think this bug is actually a duplicate of 5541 and so was fixed in commit
8d5f80a6d6db6a076f5e429f45e26ac602c25c5e (which was in 1.2 but not in the 1.1.1 I was
using when I reported the issue).

@bradfitz
Copy link
Contributor

Comment 8:

Status changed to Retracted.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants