Bug 1163126
Summary: | IllegalArgumentException when using CrawlerSessionManagerValve in EAP 6 cluster | ||||||
---|---|---|---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Lyle Wang <lywang> | ||||
Component: | Web | Assignee: | Rémy Maucherat <rmaucher> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Michael Cada <mcada> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 6.3.0 | CC: | paul.ferraro | ||||
Target Milestone: | DR11 | ||||||
Target Release: | EAP 6.4.0 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | Type: | Bug | |||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1157438 | ||||||
Attachments: |
|
Description
Lyle Wang
2014-11-12 12:27:06 UTC
Sorry, forgot a step in section "Steps to Reproduce" Steps to Reproduce: 1. Setup a 2-node EAP 6.3 cluster. Both 2 nodes use standalone-ha profile and have port offset=100 on 2nd node. Setup DEBUG logging level for root logger. 1-a. Enable "CrawlerSessionManagerValve" by adding <valve> definition into "web" subsystem in standalone-ha.xml (on both 2 nodes): ------------------------------------------------------ <subsystem xmlns="urn:jboss:domain:web:2.1" default-virtual-server="default-host" native="false"> ...... <valve name="CrawlerSessionManagerValve" module="org.jboss.as.web" class-name="org.apache.catalina.valves.CrawlerSessionManagerValve"> <param param-name="crawlerUserAgents" param-value=".*[bB]ot.*|.*Yahoo! Slurp.*|.*Feedfetcher-Google.*"/> <param param-name="sessionInactiveInterval" param-value="60"/> </valve> </subsystem> ------------------------------------------------------ 2. Deploy a "distributable" war deployment on 2 nodes (example echo.war attached) ...... r2537 in web, you should probably verify it. Should be fixed by 7.5.0.Beta5 upgrade 1157438 The posted fix won't work: https://source.jboss.org/changelog/JBossWeb?cs=2537 A non-static inner class cannot be serialized unless the parent class is also Serializable (since the object will contain an implicit reference to the parent instance). As I mention to the poster on the jboss-support-eap6 mailing list:
> Looking deeper into the actual implementation, the purpose of setting the
> value as a session attribute is only to trigger a valueUnbound() session
> event (the CrawlerSessionManagerValve implements
> HttpSessionBindingListener), which is used on session destruction to cleanup
> obsolete client IP <-> session ID mappings.
> This seems sloppy. I don't see why this couldn't be more easily achieved by
> implementing HttpSessionListener, and registering the valve as a listener
> when a new "bot" session is detected. That way, there is nothing to put in
> the session, and no need for the class to be serializable.
As I mention to the poster on the jboss-support-eap6 mailing list:
> Looking deeper into the actual implementation, the purpose of setting the
> value as a session attribute is only to trigger a valueUnbound() session
> event (the CrawlerSessionManagerValve implements
> HttpSessionBindingListener), which is used on session destruction to cleanup
> obsolete client IP <-> session ID mappings.
> This seems sloppy. I don't see why this couldn't be more easily achieved by
> implementing HttpSessionListener, and registering the valve as a listener
> when a new "bot" session is detected. That way, there is nothing to put in
> the session, and no need for the class to be serializable.
A session listener must be added to all webapps by the valve then, it's not so easy and it may not be better in practice. BTW, this valve is a utility straight from upstream Tomcat. I will modify my commit, but that is all I'm going to do about this. Trying r2544 to work around the serialization issue. Trying r2544 in a 2-node (standalone mode) EAP 6 cluster, couldn't reproduce the error anymore: --------------------- 16:58:19,365 DEBUG [org.apache.catalina.valves] (http-/127.0.0.1:8080-1) 1489346810: UserAgent=msnbot/1.1 ( http://search.msn.com/msnbot.htm) 16:58:19,365 DEBUG [org.apache.catalina.valves] (http-/127.0.0.1:8080-1) 1489346810: Bot found. UserAgent=msnbot/1.1 ( http://search.msn.com/msnbot.htm) ...... 16:58:19,390 DEBUG [org.apache.catalina.valves] (http-/127.0.0.1:8080-1) 1489346810: New bot session. SessionID=59AITeqJezBwoNA2tq2Gjfok ...... ...... 16:58:58,523 DEBUG [org.apache.catalina.valves] (http-/127.0.0.1:8180-1) 551206825: Bot found. UserAgent=msnbot/1.1 ( http://search.msn.com/msnbot.htm) 16:58:58,524 DEBUG [org.apache.catalina.valves] (http-/127.0.0.1:8180-1) 551206825: SessionID=e-qeCfNBBs2sM4JT9avuC4Pl 16:58:58,590 DEBUG [org.apache.catalina.valves] (http-/127.0.0.1:8180-1) 551206825: Bot session accessed. SessionID=e-qeCfNBBs2sM4JT9avuC4Pl --------------------- Verified in EAP 6.4.0.DR11 |