Re: Is unix socket limited to ~16KB?

From: Willy Tarreau <w#1wt.eu>
Date: Thu, 28 Feb 2008 17:09:32 +0100


On Thu, Feb 28, 2008 at 03:20:38PM +0100, Willy Tarreau wrote:
> Hi Krzysztof,
>
> On Fri, Feb 22, 2008 at 11:31:17PM +0100, Krzysztof Oledzki wrote:
> > Hello,
> >
> > It seems that there is only possible to get first 16KB of stats with unix
> > socket:
> >
> > # echo -ne "show stat\n"|./socat unix-connect:/var/run/haproxy.stat
> > stdio|wc -c -l
> > 155 16366
> >
> > Is that intentional?
>
> it is not expected at all and I think it is a bug. I'm investigating this
> issue right now.

I found the problem. It's not an implementation bug, it's a design bug. The fact is that the session getting the "show stat" or "show info" request does not hold the request, and if the response needs to reschedule, then the nature of the request is lost :-(

In the HTTP case, a somewhat similar case was addressed by the SN_STAT_FMTCSV flag, indicating if we want to read csv or html. Here we should in theory use the same principle. But doing such exceptions is quickly going to get me nuts.

So I will prefer to store several "request" parameters in the session, which will be castable depending on the request handler.

I was about to fix the problem reusing the SN_STAT_FMTCSV flag, but I don't like that. Instead, I will not fix it immediately and focus on your changes first. That way, I will reduce the risk of rejects, making it easier to fix the problem just after that. Depending on the final fix, I will either backport it to 1.3.14.3, or replace it with a quick-n-dirty reuse of the SN_STAT_FMTCSV flag for this particular version.

Best regards,
Willy Received on 2008/02/28 17:09

This archive was generated by hypermail 2.2.0 : 2008/02/28 17:15 CET