SharedSchemaContextFactory is widely used for caching context. Unfortunately it has a major deficiency around first computation: if multiple requests enter resolution process, we end up computing the schema context concurrent and only deduplicate it afterwards.
Refactor the implementation to remember futures, so concurrent accesses end up waiting for the initial computation to finish. This requires some fancy dance around references, as the indirection in cache values will mean that soft references will clean up on Future not being referenced, rather than the context not being referenced.
- relates to
-
YANGTOOLS-1293 Do not keep negative cache in SharedEffectiveModelContextFactory
- Resolved