[$25 BOUNTY] [Go] Add market gateway readiness drain flag - #127
Open
Saiaaax wants to merge 2 commits into
Open
Conversation
Add ReadinessProbe with Ready/Draining states. When draining, the /health/ready endpoint returns 503 with draining status while preserving normal healthy output otherwise. Add 6 Go tests for state transitions, string representation, gateway integration, and concurrent access. Closes #69 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Adds a readiness drain flag so operators can mark the market gateway as draining. When draining,
/health/readyreturns 503 with{"status":"draining"}while preserving normal healthy output otherwise.Closes #69
Changes
market/gateway/readiness.go—ReadinessProbewith Ready/Draining states, concurrent-safe viasync.RWMutexmarket/gateway/readiness_test.go— 6 tests:TestNewReadinessProbeStartsReady— initial state is ReadyTestSetDrainingTransitionsState— transition Ready → DrainingTestSetReadyTransitionsBack— transition Draining → ReadyTestReadinessStateString— String() labels for statesTestDrainingGatewayReturnsNotReady— gateway integrationTestConcurrentReadinessAccess— concurrent read/write safetymarket/gateway/api.go— Addedreadinessfield, updatedhandleReadiness()to check drain state, addedDrain()andReadiness()methodsdocs/OPERATIONS.md— Added "Market Gateway Readiness Drain" sectionTesting
Checklist
Payout address: 0x5253757322092903C2F0a8EfEed592344216CC7E
Diagnostic artifact reference: diagnostic/build-a2d43c2b.logd