Repository navigation
Conversation
The FDv2 data store status listener called persistent_store_outage_recovery from a block passed to define_singleton_method, where self is the listener object. Every status change raised NoMethodError, which the broadcaster logged and swallowed, so FDv2 never rewrote Redis/DynamoDB/Consul after an outage. Call the method through a Method object bound to the FDv2 instance, and add a spec that drives recovery through the status broadcaster. SDK-3812
…stop A store can report itself available while every write fails (Redis at maxmemory with noeviction, an oversized DynamoDB item). Now that the recovery listener runs, each recovery rewrites the store, the write fails, the wrapper marks the store unavailable, and its poller checked availability again with no delay. That made a tight loop of full rewrites, each holding the store lock. Wait one poll interval before the first availability check, as the Go and Java SDKs do, which bounds the cycle to one attempt per 0.5 s. FDv2#stop closes the store before shutting down the executor that delivers status changes, so a queued recovery could call init on a closed store. Return early once stopped. SDK-3812
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements
Related issues
SDK-3812. Found while reviewing the work for #504, which depends on this fix.
Describe the solution you've provided
FDv2 registers a data store status listener that should rewrite the persistent store from in-memory data when the store comes back available but stale. The listener was built with
define_singleton_method(:update) { persistent_store_outage_recovery(...) }. Inside that blockselfis the listener object, so every status change raisedNoMethodError.Broadcasterlogs and swallows listener errors, so the store was never rewritten after a Redis/DynamoDB/Consul outage.The listener now calls the recovery method through a
Methodobject bound to the FDv2 instance.The existing specs called
send(:persistent_store_outage_recovery)directly, which is why they missed this. The new spec pushes a stale status throughdata_store_status_provider.update_status, so it goes through the broadcaster. It fails without the fix.Two follow-ups that only matter once the listener runs:
noeviction, an oversized DynamoDB item). Each recovery rewrite then failed, the wrapper marked the store unavailable, and its poller checked availability again with no delay. The result was a tight loop of full rewrites, each holding the store lock.FeatureStoreClientWrapperV2now waits one 0.5 s poll interval before its first check, as Go (dataStoreStatusPoller) and Java (PersistentDataStoreStatusManager) do. That allows at most one recovery attempt per 0.5 s.persistent_store_outage_recoveryreturns early afterstop.stopcloses the store before shutting down the executor that delivers status changes, so a queued recovery could calliniton a closed store.Additional context
python-server-sdk has a related bug:
_persistent_store_outage_recoveryinldclient/impl/datasystem/fdv2.pyis defined but never registered as a listener. That is tracked separately and not fixed here.