-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to use stale cache entry over erroring out when schema cache load fails #3807
Comments
Thank you for reporting an issue! Pinging @jsenko to respond or triage. |
Adds the notion of a fault tolerance in load for production environments where it's better to use a stale cache value than die when a cache entry refresh fails. See issue Apicurio#3807 for details.
Adds the notion of a fault tolerance in refresh for production environments where it's better to use a stale cache value than die when a cache entry refresh fails. See issue Apicurio#3807 for details.
I'd like to go a little further with this design and add an option for skipping retries when we already have a cache entry , in order to optimize performance for our production use case. I'll pile that on as a second commit so that it can be rolled back if there isn't alignment on this functionality. |
Nevermind, I just read that ERCache only retries on RateLimitedClientException, so adding |
Adds the notion of a fault tolerance in refresh for production environments where it's better to use a stale cache value than die when a cache entry refresh fails. See issue Apicurio#3807 for details.
Adds the notion of a fault tolerance in refresh for production environments where it's better to use a stale cache value than die when a cache entry refresh fails. See issue #3807 for details. Co-authored-by: Devon Berry <[email protected]>
… (Apicurio#3823) Adds the notion of a fault tolerance in refresh for production environments where it's better to use a stale cache value than die when a cache entry refresh fails. See issue Apicurio#3807 for details. Co-authored-by: Devon Berry <[email protected]>
…a updates (#3839) * feat(schema-cache): ERCache.configureFaultTolerantRefresh #3807 (#3823) Adds the notion of a fault tolerance in refresh for production environments where it's better to use a stale cache value than die when a cache entry refresh fails. See issue #3807 for details. Co-authored-by: Devon Berry <[email protected]> * fix(schema-resolver): caching of latest artifacts #3834 Caching of artifacts with no version (e.g. latest) did not work because reindex would use the new key that has the artifact version that was found in the lookup. This code changes the default behavior to index both the artifact with its version and the latest/null version. It also exposes a configuration property (`apicurio.registry.cache-latest`) where this behavior can be disabled for use cases where caching of latest is not desired. See #3824 for details. --------- Co-authored-by: Devon Berry <[email protected]>
Assuming the scope of this issue is done on the linked PR. |
Feature or Problem Description
When running apicurio in a production envioronment, we would prefer to use a stale schema than error out entirely when trying to refresh the schema (i.e. intermittent network errors).
Proposed Solution
Add a to
ERCache.faultTolerantRefresh
option that instead of erroring out when a load error occurs, will log the exception and return the old value. Note that this should work alongside retries. UpdateAbstractSchemaResolver
and so it can be configured to use this type of error handling.This will be configured in
DefaultSchemaResolver
with the following boolean that defaults tofalse
to preserve the existing behavior:apicurio.registry.fault-tolerant-refresh
Additional Context
I considered a design where this information gets propagated to the caller and the caller decides, but that (1) seems to be against the design taken in the
retry
functionality, and (2) would require a contract change toERCache
significantly increasing scope.I'm happy to implement this functionality ASAP. Just wanted to align on a design @EricWittmann .
The text was updated successfully, but these errors were encountered: