mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
<!-- Describe what has changed in this PR --> **What changed?** This moves the membership monitor Start call from a fx lifecycle hook to each individual service's start method. Note: this is on top of https://github.com/temporalio/temporal/pull/4506 , which is needed so that services can still get the hostinfo (server address) to use when they, eg, initialize their service tagged loggers. <!-- Tell your future self why have you made these changes --> **Why?** In short, because a service instance shouldn't join ringpop, and hence begin to have requests forwarded to it, until it is ready to receive them. In internal testing, focusing on the impact of history service restarts/upgrades, we've seen requests suffer unnecessary delay because they were forwarded to a new history pod before it began accepting on its announced service address. <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> **How did you test it?** This has been tested in a staging environment, and for each service (listener, matching, history, worker), scaling up & down pod counts, including to/from zero. ~~Note that with this change, the history service currently generates errors at startup as it attempts lookups during its fx start sequence (inside controller_impl.go), but it will acquire shards as expected. I'll address the error logs in a quick followup PR.~~ (I addressed this in this PR.) <!-- Assuming the worst case, what can be broken when deploying this change to production? --> **Potential risks** If there's a condition that we haven't seen in testing that causes services to lookup ringpop information during fx start time, they'll see errors in places that haven't before. That could manifest as services failing to start up, or failing to take on work as quickly as they had. <!-- Is this PR a hotfix candidate or require that a notification be sent to the broader community? (Yes/No) --> **Is hotfix candidate?** No.