Uploaded image for project: 'Identity Provider'
  1. Identity Provider
  2. IDP-1501

Metadata container doesn't have ApplicationContext set

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 3.1.0, 3.1.1, 3.1.2, 3.2.0, 3.2.1, 3.3.0, 3.3.1, 3.4.0, 3.3.2, 3.3.3, 3.4.1, 3.4.2, 3.4.3, 3.4.4
    • Fix Version/s: 3.4.6
    • Component/s: None
    • Labels:
      None

      Description

      For mostĀ ReloadableSpringService beans, when applying new configuration using reload-service.sh, the old application context for the replaced component is not being closed.

      As an example of the unwanted effects of this, for the shibboleth.MetadataResolverService, all of the metadata reloading timers created in the old application contexts will still beĀ running and this noticable in the logs especially if the service is reloaded a number of times.

      The cause: The application context is supposed to be closed by AbstractServiceableComponent.unloadComponent(), but this will only occur if the local applicationContext variable is set for the component. Only two reloadable services, shibboleth.AttributeResolverService and shibboleth.AttributeFilterService, are calling setAttributeContext() in their respective Strategy classes.

      Turning up debug logging shows the "applicationContext is null" check in unloadComponent() kicking in for the other reloadable services instead of the appcontext being closed:

      2019-09-17 11:33:24,103 - DEBUG [ajp-nio-127.0.0.1-8009-exec-9] [n.s.e.s.s.ReloadableSpringService] - Service 'shibboleth.AttributeFilterService': Unloading previous configuration for service 'shibboleth.AttributeFilterService'
      2019-09-17 11:33:24,103 - DEBUG [ajp-nio-127.0.0.1-8009-exec-9] [n.s.e.s.s.AbstractServiceableComponent] - Component 'ShibbolethAttributeFilter': Component unload called
      2019-09-17 11:33:24,103 - DEBUG [ajp-nio-127.0.0.1-8009-exec-9] [n.s.e.s.s.AbstractServiceableComponent] - Component 'ShibbolethAttributeFilter': Closing the appcontext
      
      2019-09-17 11:03:44,151 - DEBUG [ajp-nio-127.0.0.1-8009-exec-9] [n.s.e.s.s.ReloadableSpringService] - Service 'shibboleth.MetadataResolverService': Unloading previous configuration for service 'shibboleth.MetadataResolverService'
      2019-09-17 11:03:44,151 - DEBUG [ajp-nio-127.0.0.1-8009-exec-9] [n.s.e.s.s.AbstractServiceableComponent] - Component 'MultiFileResolverFor:2:Resources': Component already unloaded

      Maybe an once-off fix for this is to just set the appContext against the component returned by the serviceStrategy in ReloadableSpringServic.doReload() (although it will need an instanceof AbstractServiceableComponent check). Might also be worth putting in a check to only set it if service.getApplicationContext() is still null (just in case someone is manually using a wrapper or something similar in a custom strategy implementation).

        Attachments

          Activity

            People

            Assignee:
            rdw@iay.org.uk Rod Widdowson
            Reporter:
            arthur2@vho.aaf.edu.au Jamie Arthur
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 15 minutes
                4h 15m