KamoCRM

Keep retrying the indexer's durable NATS consumer after a deploy

FixEmailService
Shipped
5 ஆகஸ்ட், 2026 அன்று 11:23 PM UTC
Author
Kamo
Commit
038196a

A rolling deploy overlaps pods and the outgoing one still holds the durable consumer, so the incoming pod's bind to "email-metadata-indexer" fails with [SUB-90012] Consumer is already bound to a subscription. start() ran once from @PostConstruct, logged the error and gave up, so push indexing stayed dead for the entire life of that pod -- every deploy silently stopped indexing new mail until someone restarted it by hand, and nothing surfaced that it had happened. Retry on a daemon scheduler until the old pod releases the consumer, and stop cleanly on shutdown so the retry cannot outlive the bean.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing