https://bz.apache.org/bugzilla/show_bug.cgi?id=66541

            Bug ID: 66541
           Summary: CachedResource for OSGi URL resources changes URL
                    hashing behavior & exacerbates DNS issues
           Product: Tomcat 8
           Version: 8.5.x-trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: tom.whitm...@lyniate.com
  Target Milestone: ----

We run Tomcat with resources mounted from OSGi bundles. The OSGi URLs are of
the form 'bundleentry://203.fwk668849042/META-INF/output.tld' and have a custom
'handler' assigned to handle them.

In Tomcat 8.5.48, changes were made to CachedResource (to fix "Intermittent JSP
Caching/Compiling Issue while under load", 2b0aaedd76d8) which introduce
CachedResourceURLStreamHandler & bypass the OSGi-supplied hashCode() behavior
of the OSGi URLs.

Several of our end-users have now reported large delays (up to 40 minutes) in
Tomcat startup. The problem is:
* TldScanner hashing URLs of TLDs -- about 150 of these -- to build its
tldResourcePathTaglibXmlMap.
* The OSGi URLs are now having java.net.URLStreamHandler hash them & this
attempts to resolve their Hostnames, where the OSGi (Equinox) handler did not.
* In the case of DNS misconfiguration on some platforms, which seems to be not
uncommon amongst our end-users, Tomcat thus has to wait for 150 failed lookups
(of OSGi bundle names) at 15 seconds each before starting.

Proposed solution approach: 
* Consider making CachedResourceURLStreamHandler delegate 'hashCode()' and
'equals()' to the underlying 'resourceURL'.
* This will preserve handler behaviors from the underlying URL and avoid
introducing spurious DNS lookups for OSGi-loaded resources.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to