Bring Dynamic Metadata Provider up to functional equivalence to IdP one

Description

Precise scoping is TBD and my first task...

Environment

None

Activity

Scott Cantor May 18, 2018 at 12:46 AM

Added HTTP caching. Also added check for non-200 status. The MDQ language restricts the success possibilities to 304 and 200. The SOAP layer we're reusing already throws on anything >= 400 but this is a defensive check.

Scott Cantor May 17, 2018 at 11:18 PM

Revamped the code with something that passes the eyeball test. Also implemented a cache tag hook and used it to optimize the local dynamic subclass.

I forced minCacheDuration to 30 seconds to correct the loop problem, it was much easier than the alternatives.

Added some comments that speak to some of the trickier issues.

The HTTP version should be straightforward to add the caching enhancement to now, that's not done yet.

Scott Cantor May 16, 2018 at 4:28 PM

There are a few obvious ways to tackle it certainly, but it ties very tightly into whether I can integrate a stat() check into the process to bypass extra reloads so now that I know I'm not wrong, I'll take it into consideration as I keep working on this.

Rod Widdowson May 15, 2018 at 12:07 PM

Hypothesis confirmed,  If the recusrion happens within the same tick then the condition hits because 

if (time(nullptr) <= cit->second)

Is true. Gonna suck rocks on a busy machine mind you.

If you set a breakpoint and "wait a wee bit" at the

// Rinse and repeat. return getEntityDescriptor(criteria);

then we chew stack:

> saml3_0D.dll!opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor(const opensaml::saml2md::MetadataProvider::Criteria & criteria) Line 361 C++ saml3_0D.dll!opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor(const opensaml::saml2md::MetadataProvider::Criteria & criteria) Line 361 C++ saml3_0D.dll!opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor(const opensaml::saml2md::MetadataProvider::Criteria & criteria) Line 361 C++ saml3_0D.dll!opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor(const opensaml::saml2md::MetadataProvider::Criteria & criteria) Line 361 C++ saml3_0D.dll!opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor(const opensaml::saml2md::MetadataProvider::Criteria & criteria) Line 361 C++ saml3_0D.dll!opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor(const opensaml::saml2md::MetadataProvider::Criteria & criteria) Line 361 C++ saml3_0D.dll!opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor(const opensaml::saml2md::MetadataProvider::Criteria & criteria) Line 361 C++ saml3_0D.dll!opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor(const opensaml::saml2md::MetadataProvider::Criteria & criteria) Line 361 C++ saml3_0D.dll!opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor(const opensaml::saml2md::MetadataProvider::Criteria & criteria) Line 361 C++ UnitTests.exe!DynamicMetadataTest::performTest(std::basic_string<char,std::char_traits<char>,std::allocator<char> > fileName, bool artifactOnly, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > type) Line 91 C++

I suppose we need to add a handful (20, 100?) milliseconds dither into the system. But I'm close to the problem and there is almost certainly a better solution at the configuration level (making max be at least 1sec more than min?)

Scott Cantor May 15, 2018 at 11:53 AM

Yes, its the subsecond looping that concerns me. I can see that it would perhaps be rare, but I didn't know how rare, and it's safe to say that we don't really want to depend on that.

I'm still looking at how to rethink this, but with my surgery imminent I'll have to park it.

Fixed

Details

Assignee

Reporter

Original estimate

Components

Fix versions

Created October 1, 2017 at 8:56 AM
Updated July 17, 2018 at 2:48 PM
Resolved May 18, 2018 at 12:46 AM