Alipay callback process restarts: drain requests and verify commits
Killing a callback process during deployment can leave a confirmed payment with an unknown processing result. Stop new traffic and account for requests already running. Process exit, an HTTP reply and business credit are separate events. This is merchant-side design, not a 稳付pay orchestration feature.
Continue by topic
Confirm merchant terms and shutdown boundaries
稳付pay publicly lists WeChat Pay, Alipay and UnionPay, subject to formal configuration; this guide concerns Alipay notifications. Confirm business approval, account setup, callbacks and query contracts. Obtain production gateways, merchant parameters and secrets privately. Ask the team about fee basis, transaction and cumulative limits, and exception-investigation costs; restarting your app does not revise an existing quote.
Merchant USDT settlement of CNY collections currently uses TRON/TRC20 only. Confirm minimums, exchange basis, triggers and timing separately. Track payment confirmation, customer balance or entitlement delivery, and merchant settlement independently. Assign owners for the callback route, load balancer, workers and pending tasks; a successful restart does not prove all three outcomes.
Remove traffic before draining work
Before deployment record the application version, internal deployment reference, running-request count and redacted pending-order references. Stop assigning new requests to the old instance, verify healthy instances receive new traffic, and let admitted handlers finish. A readiness change does not mean every proxy or persistent connection has switched instantly.
Normal Kubernetes termination has a grace period and can still end forcibly when it expires. Check actual signals and timeouts on your own platform instead of copying a fixed sleep. Drain requests before releasing database connections. Separately stop consumers from claiming new tasks and preserve recoverable task identities; an in-memory queue is not durable acceptance.
Recover around the commit boundary
Verify signatures under the formal contract and check ownership, order, currency, amount and success. Within one merchant transaction save a unique payment claim, order update and ledger entry or delivery task. Reply only when contractual acceptance conditions are met. Old and new processes must share durable deduplication scope; a deployment reference must not create a new fulfillment identity.
Example DEMO-D: if terminated before commit, establish rollback and recover the original notification or authorized investigation. If commit succeeded but the reply was lost, retrieve the original committed proof and reuse it. A connection lost during COMMIT leaves an unknown result, requiring inspection before adding credit again. Check the original external delivery reference too; local transactions cannot guarantee exactly-once external effects.
Test shutdown failures and reconcile
Use isolated simulated records to terminate before verification, during a transaction and after commit but before reply. Test drain timeout and duplicate callbacks reaching old and new processes together. Each purchase must increase business value once. Uncommitted requests must not receive premature success, and unknown results need an assigned owner and review time. Do not create real payments or query customer transactions for this exercise.
Reconcile trusted payments, business ledger, external delivery proof and separate TRC20 settlement receipts. Check new-instance health, zero remaining requests on the old instance, oldest pending work and errors before closing deployment. Provider retries follow the actual contract and may be finite; do not depend on endless retries. Rolling back application code must not delete committed payments or tasks.
Frequently asked questions
Does a longer shutdown timeout guarantee safety?
No. Traffic propagation, persistent connections, transactions and external delivery have different boundaries. Inspect running work and durable evidence.
What if restart loses the in-memory deduplication flags?
Look up durable records using original payment and delivery identities. Memory-only deduplication is a design gap, not permission to credit again.