Openbravo Issue Tracking System - Retail Modules
View Issue Details
0040111Retail ModulesStoreServerpublic2019-02-03 10:412019-02-06 14:35
mtaal 
mtaal 
normalcriticalhave not tried
closedfixed 
5
 
 
No
0040111: SS should store/use all central cookies to ensure correct working in combination with load balancer
Problem description
- the store server in online mode is like a proxy, it forwards (almost) all requests to the central server and returns the response.
- when calling central the store server will try to use always the same session on central for a user, so webpos user A will have its own http session on the store server and it's own on the central server.
- the store server does this by keeping the session id cookie from the central server in memory (in its http session for the user A), so when user A does a next request from the WebPOS it will take that cookie and include it in the request.
- this works fine in our environments without loadbalancer
- BUT has a load balancer with sticky sessions
- the loadbalancer implements sticky session by sending back a special cookie, so when it receives a new request with this cookie it assigns the request to the same node as before, which has the correct http session ready to be used
- the store server however does not keep this special cookie, therefore requests through the store server can be and are assigned to different nodes by the loadbalancer, recreating sessions there.

This issue was also there last year in november we/I think.

The fix will be to store all the cookies (not only JSESSIONID). I have worked on a fix which works on my dev laptop, but will test it some more tomorrow morning.
See Description
Store all cookies
No tags attached.
Issue History
2019-02-03 10:41mtaalNew Issue
2019-02-03 10:41mtaalAssigned To => mtaal
2019-02-03 10:41mtaalTriggers an Emergency Pack => No
2019-02-03 10:42hgbotCheckin
2019-02-03 10:42hgbotNote Added: 0109460
2019-02-03 10:42hgbotStatusnew => resolved
2019-02-03 10:42hgbotResolutionopen => fixed
2019-02-03 10:42hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/d671a6a95bb9d0565890e52ccfa4dac3aa4cb2a0 [^]
2019-02-06 14:35AugustoMauchNote Added: 0109633
2019-02-06 14:35AugustoMauchStatusresolved => closed

Notes
(0109460)
hgbot   
2019-02-03 10:42   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: d671a6a95bb9d0565890e52ccfa4dac3aa4cb2a0
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Feb 03 10:42:13 2019 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/d671a6a95bb9d0565890e52ccfa4dac3aa4cb2a0 [^]

Fixes issue 40111: SS should store/use all central cookies to ensure correct working in combination with load balancer
Store all cookies, note a map is used as not all cookies are resend at every response. The session cookie is only
send when changed by the server, so it is kept in a map and updated when the response returns.

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java
---
(0109633)
AugustoMauch   
2019-02-06 14:35   
Code reviewed and verified