tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mitch Claborn <mitch...@claborn.net>
Subject Potential change to DeltaManager
Date Fri, 21 Sep 2018 17:02:03 GMT
Please forgive me if this is the incorrect place or format for 
discussing this. I'm new to trying to develop for Tomcat.

I'm developing a patch for DeltaManager and I'd like to discuss with you 
developers if it could be considered for inclusion in the base code. 
Please see details below and comment.

Problem: When the "all sessions" message is sent from one node to 
another, when the receiving node is first starting up, I often run into 
various errors with one of the sessions and it fails to deserialize. 
This causes all the remaining sessions in that chunk 
(sendAllSessionsSize) to be lost by the receiver. The problem with the 
sessions is totally an application problem, but until I can figure those 
problems out and solve them I need a way to limit the impact of these 
problems to just the one session that is in error. I could set 
sendAllSessionsSize="1" but that would take a LONG time to transmit, and 
we have many thousands of sessions at any given time.

Change details:

 1. Update
    org.apache.catalina.ha.session.DeltaManager.deserializeSessions(byte[])
    and
    org.apache.catalina.ha.session.DeltaSession.doReadObject(ObjectInput)
    to produce a more detailed error message when a session is in
    error.  New error message includes: the session index in the list of
    sessions, the session ID, the last field or attribute that was
    attempted to be read.
 2. Introduce new XML attribute verifySerializedSessions for DeltaManager.
 3. If verifySerializedSessions="true",
    org.apache.catalina.ha.session.DeltaManager.serializeSessions(Session[])
    will first serialize each session then immediately deserialize it.
    If all is good, send the session as usual.  If any errors are
    encountered, create and send a dummy session with a known session ID
    instead. (This keeps the session count, which has already been put
    in the output stream, correct for the receiving node.)
 4. Update
    org.apache.catalina.ha.session.DeltaManager.deserializeSessions(byte[])
    to discard any received session that has the known dummy session ID.

-- 

Mitch


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message