Quantcast
Channel: Serverphorums.com - HAProxy
Viewing all articles
Browse latest Browse all 5112

[PATCH] OPTIM/MINOR: session: abort if possible before connecting to the backend (1 reply)

$
0
0
Hi Willy,

The approach to look at the state of the connection in
sess_update_stream_int() does work as expected. Please see the
attached patch.

Thanks,
Frederik

On Wed, Apr 6, 2016 at 10:45 AM, Frederik Deweerdt <fdeweerdt@fastly.com> wrote:
> On Wed, Apr 6, 2016 at 9:53 AM, Willy Tarreau <w@1wt.eu> wrote:
> [...]
>
>> So this means that in TCP mode we're aware of the abort earlier than in
>> HTTP mode. Thus we theorically have everything needed to decide not to
>> connect if possible.
>>
> /me nods, it appears so.
>
>> This one will result in truncated transfers when shutting down at the end
>> so we must not do it this way, but I see your point. I guess one reason
>> why TCP's abort is not caught is that we don't enter process_stream() once
>> the connection is established and we don't have any more analysers (which
>> is true in TCP). In HTTP we have several opportunities to get back there
>> and possibly to abort the connection early.
>>
>> I think that we'd need to add tests for PR_O_ABRT_CLOSE before deciding
>> to establish a connection, it's done in sess_update_stream_int(), for
>> state SI_ST_ASS. In certain states such as SI_ST_QUE (queue) or SI_ST_TAR
>> (turn-around, wait before retrying), the test is already performed, but
>> its missing here before the call to connect_server(). Do you want to try
>> this instead ? If it works, simply send a patch with a description
>> according to the CONTRIBUTING file and I'll happily merge it.
>>
> That sounds good, I'll try that.
>
> Thanks!
> Frederik

Viewing all articles
Browse latest Browse all 5112

Trending Articles