Skip to content

[$25 BOUNTY] [Go] Add market gateway readiness drain flag - #127

Open
Saiaaax wants to merge 2 commits into
jaxassistant55:mainfrom
Saiaaax:bounty69-readiness-drain
Open

[$25 BOUNTY] [Go] Add market gateway readiness drain flag#127
Saiaaax wants to merge 2 commits into
jaxassistant55:mainfrom
Saiaaax:bounty69-readiness-drain

Conversation

@Saiaaax

@Saiaaax Saiaaax commented Jun 24, 2026

Copy link
Copy Markdown

Summary

Adds a readiness drain flag so operators can mark the market gateway as draining. When draining, /health/ready returns 503 with {"status":"draining"} while preserving normal healthy output otherwise.

Closes #69

Changes

  • New: market/gateway/readiness.goReadinessProbe with Ready/Draining states, concurrent-safe via sync.RWMutex
  • New: market/gateway/readiness_test.go — 6 tests:
    • TestNewReadinessProbeStartsReady — initial state is Ready
    • TestSetDrainingTransitionsState — transition Ready → Draining
    • TestSetReadyTransitionsBack — transition Draining → Ready
    • TestReadinessStateString — String() labels for states
    • TestDrainingGatewayReturnsNotReady — gateway integration
    • TestConcurrentReadinessAccess — concurrent read/write safety
  • Updated: market/gateway/api.go — Added readiness field, updated handleReadiness() to check drain state, added Drain() and Readiness() methods
  • Updated: docs/OPERATIONS.md — Added "Market Gateway Readiness Drain" section

Testing

cd market && go test ./gateway/ -run Readiness -v

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated, if applicable
  • Configuration or schema changes are documented, if applicable
  • No generated build artifacts are committed, except the required diagnostic build log
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

  • I would like to request that my diagnostic build log is removed before merging

Payout address: 0x5253757322092903C2F0a8EfEed592344216CC7E
Diagnostic artifact reference: diagnostic/build-a2d43c2b.logd

Saiaaax and others added 2 commits June 24, 2026 21:01
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[$25 BOUNTY] [Go] Add market gateway readiness drain flag

1 participant