mlem commented on issue #154: Don't serialize CrawlerSessionManagerValve into 
session attributes
URL: https://github.com/apache/tomcat/pull/154#issuecomment-481173301
 
 
   > But the implementation doesn't actually stop anything from being 
serialized: those two big maps are still serialized along with the rest of the 
stream. What you are avoiding is serializing the class loader which is 
happening because of the Valve itself.
   
   In comparison to the container object (which holds plenty of stuff, as I've 
seen) this doesn't seem like a big deal. As I understood, there is one entry 
for each crawler (1 crawler = 1 entry in map x2 = clientId x2 + sessionId x2). 
we would need to have plenty of crawlers within 60 seconds to fill this map big 
enough to make it serious. 
   
   > Instead of storing something in the session, CrawlerSessionManagerValve 
should instead be changed to be an HttpSessionListener which won't be 
serialized when the session is written-out. It has the added benefit of being 
simpler than the current code.
   
   That sounds good, but I would need to hook into the lifecycle of this valve 
(or into the lifecycle of the web application itself). Due to the dynamic 
nature of your valves, I don't know where this class get's initialized. Can you 
point me out, where I would register this listener?
   
   > Using an HttpSessionListener gets tricky because it has to be registered 
with every web application. That is do-able but will add a fair amount of 
complexity - particularly to handle automatic deployment.
   > 
   > The patch looks reasonable. I can't think of a better way to handle this.
   
   I see it the same way. And thanks.
   
   I'll change the title again.
   Do you need a changed commit message too?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to