6.0.0-git
2021-01-18

[#7394] persist the syncml state in multiserver environments
Summary persist the syncml state in multiserver environments
Queue Synchronization
Type Enhancement
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester adrieder (at) sbox (dot) tugraz (dot) at
Created 2008-09-25 (4498 days ago)
Due 09/26/2008 (4497 days ago)
Updated 2008-10-07 (4486 days ago)
Assigned
Resolved 2008-10-07 (4486 days ago)
Milestone
Patch No

History
2008-10-07 12:47:30 Jan Schneider Comment #5
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
Committed, thanks.
2008-10-02 21:13:19 adrieder (at) sbox (dot) tugraz (dot) at Comment #4
New Attachment: Horde.php.patch Download
Reply to this comment
The _backendMode is not set on the server when a loadbalancer directs 
the client to another machine.

The attached patch fixes the problem.
2008-09-25 20:08:44 adrieder (at) sbox (dot) tugraz (dot) at Comment #3 Reply to this comment
Synching uses regular PHP sessions, with the only difference that the
session id is not passed by cookie or url parameter, but in the sync
packet.
Is synching not using the configured session handler in your case?
well I think/hope that it is using the same session handler as all the 
other Horde parts.



Here is what I've set in conf.php for sessions:



$conf['session']['name'] = 'Horde';

$conf['session']['use_only_cookies'] = true;

$conf['session']['cache_limiter'] = 'nocache';

$conf['session']['timeout'] = 0;

[...]

$conf['sessionhandler']['params']['track'] = true;

$conf['sessionhandler']['type'] = 'memcache';

$conf['sessionhandler']['memcache'] = true;



I can not think at anything how syncing should use something else?


2008-09-25 19:34:12 Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Synching uses regular PHP sessions, with the only difference that the 
session id is not passed by cookie or url parameter, but in the sync 
packet.

Is synching not using the configured session handler in your case?
2008-09-25 19:15:45 adrieder (at) sbox (dot) tugraz (dot) at Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 2. Medium
Summary ⇒ persist the syncml state in multiserver environments
Due ⇒ 2008-09-26
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
Reply to this comment
I'm not sure if this is a bug therefore I write this feature request:



In a setup which uses multiple loadbalanced servers with a shared 
session backend (memcached) it can happen that the loadbalancer 
redirects requests which belong to the same sync session to different 
servers, e.g. when the database (calendar for e.g.) is large the sync 
is divided into more then one request:



Here is a log for such a case:

DEBUG:  Backend of class SyncML_Backend_Horde created

DEBUG:  Started at 2008-09-25 20:49:48. Packet logged in 
/tmp/sync/client_10.wbxml

DEBUG:  New session created: 3baf28e3f425a8aa4cb8281f978e16ee

DEBUG:  Checking authentication for user riederd

DEBUG:  Authenticated: yes; version: 1.2; message ID: 1; source URI: 
IMEI:xxxxxxxxxxxxxx; target URI: ....

[....]

DEBUG:  Return message completed

DEBUG:  Finished at 2008-09-25 20:49:48. Packet logged in 
/tmp/sync/server_10.wbxml



DEBUG:  Backend of class SyncML_Backend_Horde created

DEBUG:  Started at 2008-09-25 20:49:55. Packet logged in 
/tmp/sync/client_11.wbxml

DEBUG:  Existing session continued: 3baf28e3f425a8aa4cb8281f978e16ee

DEBUG:  Authenticated: yes; version: 1.2; message ID: 2; source URI: 
IMEI:xxxxxxxxxxxxxx; target URI: ....

DEBUG:  Created device class SyncML_Device_Nokia

DEBUG:  Created device class SyncML_Device_Nokia

DEBUG:  Received <Final> from client.

DEBUG:  Handle <Final> for state Sync

DEBUG:  Creating <Sync> output for server changes in database ./notes

DEBUG:  Created device class SyncML_Device_Nokia

DEBUG:  Compiling server changes from 1970-01-01 01:00:00 to 
2008-09-25 20:49:48

[...]

DEBUG:  Sending add from server: 20070628193702.@webmail.tugraz.at

DEBUG:  Sending add from server: 20070628193732.@webmail.tugraz.at

DEBUG:  Maximum message size 65535 approached during add; current size: 65072

DEBUG:  Return message completed

DEBUG:  Finished at 2008-09-25 20:50:00. Packet logged in 
/tmp/sync/server_11.wbxml



the next request is switched to another server, which results into a 
authentication error:



DEBUG:  Backend of class SyncML_Backend_Horde created

DEBUG:  Started at 2008-09-25 20:50:16. Packet logged in 
/tmp/sync/client_10.wbxml

DEBUG:  New session created: 3baf28e3f425a8aa4cb8281f978e16ee

DEBUG:  Invalid authentication

DEBUG:  Authenticated: no; version: 1.2; message ID: 3; source URI: 
IMEI:xxxxxxxxxxxxxx; target URI:

ERR:    Not authenticated while processing MapItem

ERR:    Not authenticated while processing MapItem

[....]

ERR:    Not authenticated while processing MapItem

DEBUG:  Return message completed

DEBUG:  Finished at 2008-09-25 20:50:17. Packet logged in 
/tmp/sync/server_10.wbxml



It seems that $_SESSION['SyncML.state'] gets lost between the requests 
when they go from different servers.

In other Horde applications (like IMP) it is no problem when different 
requests go to different servers.



Would it be possible to keep the Session active for different servers?

Saved Queries