Bug 58582 - org.apache.catalina.realm.CombinedRealm should implement backgroundProcess
Summary: org.apache.catalina.realm.CombinedRealm should implement backgroundProcess
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: All All
: P2 minor (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2015-11-04 14:57 UTC by Aidan
Modified: 2015-11-05 17:06 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Aidan 2015-11-04 14:57:53 UTC
org.apache.catalina.realm.CombinedRealm should implement backgroundProcess() by calling this method on each of the Realms it manages e.g.

    public void backgroundProcess()
        for( Realm r: realms )

        // for Tomcat9 ;-)
        // realms.forEach( r -> r.backgroundProcess() );

Without this, the backgroundProcess() of a Realm that is wrapped by CombinedRealm or LockOutRealm (which extends CombinedRealm) is not called.

Comment 1 Christopher Schultz 2015-11-04 19:36:45 UTC
Thanks for the patch, which I modified slightly. Please let me know if you'd prefer a name other than "Aidan" for your patch credit in the changelog.

Fixed in trunk in r1712617. Will be in Tomcat 9.0.0.
Back-ported to Tomcat 8 branch in r1712618. Will be in Tomcat 8.0.29.
Comment 2 Konstantin Kolinko 2015-11-04 21:38:14 UTC
Fixed in Tomcat 7 and Tomcat 6 as well, will be in 7.0.66, 6.0.45.
Comment 3 Aidan 2015-11-05 09:09:10 UTC
Wow! - a very impressive response - keep up the good work guys!
Yep, Aidan is fine for patch credit but please feel free to use your own name.
Comment 4 Aidan 2015-11-05 16:54:06 UTC
BTW, I have a simple enhancement patch for org.apache.catalina.realm.MemoryRealm that uses backgroundProcess() to reload conf/tomcat-users.xml when it's modified - would you be interested in that ?
Comment 5 Mark Thomas 2015-11-05 17:06:06 UTC
Yes, in a new bugzulla enhancement please.