haproxy-spoe-go icon indicating copy to clipboard operation
haproxy-spoe-go copied to clipboard

Broken pipe on unix socket error handle worker: error send AgentDisconnect frame

Open alechenninger opened this issue 4 years ago • 4 comments

When listening on a unix socket, I get this error a few seconds after each event is processed:

2020/12/14 18:37:58 error handle worker: error send AgentDisconnect frame: write unix /var/run/gohaproxy/agent.sock->@: write: broken pipe

Example code https://github.com/alechenninger/go-haproxy-agent/blob/cd1d9681bcfe818f134dc1bc2d2ba1ec4e5983f2/main.go#L43

I've tried both listneing on "unix" and "unix packet"

Haproxy configs here https://github.com/alechenninger/go-haproxy-agent/tree/cd1d9681bcfe818f134dc1bc2d2ba1ec4e5983f2/conf

alechenninger avatar Dec 14 '20 19:12 alechenninger

Some additional context: I'm seeing this on mac while using docker for mac, and a shared unix socket between containers. Docker for Mac doesn't support unix sockets from the mac OS host, but it does in between containers.

I tried switching to https://github.com/criteo/haproxy-spoe-go and am seeing the same results, so wondering if this is a product of my environment.

alechenninger avatar Dec 14 '20 19:12 alechenninger

Did a bit more experimenting. Looks like timeout handling is different with unix sockets vs tcp.

With TCP, server and idle timeouts don't trigger errors.

With unix sockets, server and idle timeouts do trigger errors. This affects both this and the criteo libraries.

It seems benign, and may just warrant higher timeout values to reduce noise.

alechenninger avatar Dec 14 '20 22:12 alechenninger

Thank you for such a detailed description. Can I close this issue?

negasus avatar Dec 15 '20 08:12 negasus

It seems like a bug that one protocol emits error logs when another doesn't. It may be misleading, because AFAICT these aren't really meaningful "errors" in the sense that nothing appears to be actually wrong. Ultimately, whether you leave the issue open is up to you.

alechenninger avatar Dec 17 '20 18:12 alechenninger