Re: appsession not sticking?

2013-04-24 Thread Matthew Wild
Hi,

On 24 April 2013 06:35, Baptiste bed...@gmail.com wrote:
 Hi Mattew,

 You can first send us your configuration :)

It was linked in my post :)

Again: https://gist.github.com/mwild1/19560e39196f49da4ae2

I've been doing some further digging. Is it possible that haproxy only
learns from the first request/response on a connection? That would
explain the behaviour I'm seeing.

Regards,
Matthew



Re: appsession not sticking?

2013-04-24 Thread Matthew Wild
On 24 April 2013 10:40, Matthew Wild mwi...@gmail.com wrote:
 I've been doing some further digging. Is it possible that haproxy only
 learns from the first request/response on a connection? That would
 explain the behaviour I'm seeing.

Indeed, this seems to be the case. I also finally found a reference to
it in the initial section of the config file (not under any of the
sections discussing stickiness...).

Problem solved with http-server-close, thanks.

Regards,
Matthew



appsession not sticking?

2013-04-23 Thread Matthew Wild
Hi,

I'm setting up a new haproxy deployment, and am having some problems
trying to get sessions correctly sticking to backend servers.

Since it's new, it's worth firstly checking that I haven't made any
configuration mistakes, I'm currently testing with this:
https://gist.github.com/mwild1/19560e39196f49da4ae2

I've done some debugging, and this is the usual flow I see:

  -- Connection 1
  OPTIONS-OK (backend 1) ; cross-domain pre-flight request
  POST-OK (backend 1) (cookie is set in this response)
  POST-OK (backend 1)
  POST- (backend 1) ; Here backend 1 holds the connection open (long poll)

  ; The client makes a new request, and the browser opens a new
connection because connection 1 is blocked
  -- Connection 2
  POST-ERROR (backend 2)

All the POST requests made by the browser (Chrome) have the correct
cookie once it is set in the first POST response.

One possibility - perhaps haproxy only stores the cookie value when
the connection closes? Since connection 1 doesn't close, connection 2
does not get associated with the correct backend. Just a theory...

Any advice or suggestions? I hope it is something simple I'm missing :)

Regards,
Matthew



Re: appsession not sticking?

2013-04-23 Thread Baptiste
Hi Mattew,

You can first send us your configuration :)

Browser are supposed to send cookies over 2 different connections for
the same domain.
So maybe you could log the Host header and the Set-Cookie header as well.

Baptiste

On Tue, Apr 23, 2013 at 11:54 AM, Matthew Wild mwi...@gmail.com wrote:
 Hi,

 I'm setting up a new haproxy deployment, and am having some problems
 trying to get sessions correctly sticking to backend servers.

 Since it's new, it's worth firstly checking that I haven't made any
 configuration mistakes, I'm currently testing with this:
 https://gist.github.com/mwild1/19560e39196f49da4ae2

 I've done some debugging, and this is the usual flow I see:

   -- Connection 1
   OPTIONS-OK (backend 1) ; cross-domain pre-flight request
   POST-OK (backend 1) (cookie is set in this response)
   POST-OK (backend 1)
   POST- (backend 1) ; Here backend 1 holds the connection open (long poll)

   ; The client makes a new request, and the browser opens a new
 connection because connection 1 is blocked
   -- Connection 2
   POST-ERROR (backend 2)

 All the POST requests made by the browser (Chrome) have the correct
 cookie once it is set in the first POST response.

 One possibility - perhaps haproxy only stores the cookie value when
 the connection closes? Since connection 1 doesn't close, connection 2
 does not get associated with the correct backend. Just a theory...

 Any advice or suggestions? I hope it is something simple I'm missing :)

 Regards,
 Matthew