In order to gain fault tolerance, I'm running haproxy between Thruk and multiple nagios backends with the Livestatus plugin. Thruk has no connection timeout, so a "dead" backend causes Thruk to take forever to load, usually resulting in a timeout from apache (which is proxying to Thruk via fcgi).

I'm having a problem when Thruk sends an external command. The client doesn't expect a response from the server, so it immediately closes the connection after sending its data. This apparently causes haproxy to drop the connection if it hasn't yet established a connection to the remote server. It results in log entries like this: [07/Apr/2014:12:39:17.268] thruk_backend_nagios2_6557_6559 thruk_backend_nagios2_6557_6559/nagios2 0/-1/0 0 CC 0/0/0/0/0 0/0

The CC apparently means that the client closed the connection unexpectedly while haproxy was trying to connect to the backend server. Once this happens, haproxy does not continue trying to establish the connection to the backend, which means that the data that the client sent gets dropped on the floor.

I thought that the tcp-smart-accept/connect options may help, but they had no effect.

Is there something I can do here other than modifying the client or adding some sort of store-and-forward TCP proxy between Thruk and haproxy? Is there an option for haproxy that will cause it to buffer the client's request and send it on to the server once the connection has been established, even if the client is gone?

  • 1
    I apparently can't answer my own question for 8 hours after asking, so I'll just comment. This was solved by adding 'no option abortonclose' to my listen sections. This was needed because 'option abortonclose' is in the default section of our templates haproxy configs :( – Andrew Gaffney Apr 7 '14 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.