fix: fenced lock release, wire retry processor, guard indexer metrics on RPC fail, yield tests#1281
Open
dikachim060-wq wants to merge 1 commit into
Open
Conversation
… on RPC fail, add yield tests closes LabsCrypt#1163 closes LabsCrypt#1167 closes LabsCrypt#1171 closes LabsCrypt#1201
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.
Summary
deleteIfMatch(key, expectedValue)tocacheService.tsand updateddefaultChecker.acquireLockto store the fencing token inthis.currentLockValue.releaseLocknow callsdeleteIfMatchinstead of unconditionaldelete, so a run that outlives the 10-minute TTL cannot delete a lock acquired by a second instance.webhookRetryScheduler.ts(used a different backoff, ignorednext_retry_at).index.tsnow wiresstartWebhookRetryProcessor/stopWebhookRetryProcessorinstead. Added a doc comment towebhookRetryProcessor.tsdescribing the effective 5m/15m/45m backoff schedule and 4-attempt cap.yieldHistoryService.test.tswith four new tests:Withdrawreduces cost basis proportionally,EmergencyWithdrawfollows the same path, base64 XDR value is decoded (BigInt shares extracted), and malformed XDR falls back gracefully without throwing.eventIndexer.pollOnce, skip therecordIndexerLedgerscall whenlatestLedger === 0(RPC failure). Gauges are left at their last known values so the behind-chain-tip alert fires correctly during an outage instead of silently reading 0.Test plan
npm test -- --testPathPattern yieldHistoryServicepasses including new Withdraw/XDR testswebhookRetryScheduler.tsis removed and no import references remainindexerLagLedgersGaugestays at its last non-zero valuecloses #1163
closes #1167
closes #1171
closes #1201