[Serve] Remove shutdown() method from TaskProcessorAdapter#59713
[Serve] Remove shutdown() method from TaskProcessorAdapter#59713abrarsheikh merged 4 commits intoray-project:masterfrom
Conversation
…stop_consumer() Signed-off-by: krisselberg <kselberg@princeton.edu>
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a critical issue in the task_consumer's __del__ method by removing the call to shutdown(). This change prevents a broadcast shutdown of all workers when a single replica is terminated, which is crucial for the stability of rolling updates. The fix is well-justified and implemented correctly.
The new unit test test_task_consumer_cleanup_only_calls_stop_consumer is an excellent addition. It clearly verifies the intended behavior and ensures this regression won't occur in the future.
I've added one minor comment regarding the test implementation, suggesting a potential future refactoring for the mock object to improve test isolation. Overall, this is a high-quality contribution that improves the robustness of Ray Serve.
|
@harshit-anyscale could you take a look |
Signed-off-by: krisselberg <kselberg@princeton.edu>
…risselberg/ray into fix-task-consumer-del-shutdown Signed-off-by: krisselberg <kselberg@princeton.edu>
…ct#59713) ## Description Fix @task_consumer decorator's __del__ method calling shutdown() which broadcasts to all Celery workers instead of just the local one. This kills newly started workers during rolling updates. ## Related issues None ## Additional information Removed self._adapter.shutdown() from __del__ - only stop_consumer() should be called since it targets the specific worker hostname. Also removed shutdown() implementation & from interface given it is not used anywhere --------- Signed-off-by: krisselberg <kselberg@princeton.edu> Signed-off-by: jasonwrwang <jasonwrwang@tencent.com>
…ct#59713) ## Description Fix @task_consumer decorator's __del__ method calling shutdown() which broadcasts to all Celery workers instead of just the local one. This kills newly started workers during rolling updates. ## Related issues None ## Additional information Removed self._adapter.shutdown() from __del__ - only stop_consumer() should be called since it targets the specific worker hostname. Also removed shutdown() implementation & from interface given it is not used anywhere --------- Signed-off-by: krisselberg <kselberg@princeton.edu>
…ct#59713) ## Description Fix @task_consumer decorator's __del__ method calling shutdown() which broadcasts to all Celery workers instead of just the local one. This kills newly started workers during rolling updates. ## Related issues None ## Additional information Removed self._adapter.shutdown() from __del__ - only stop_consumer() should be called since it targets the specific worker hostname. Also removed shutdown() implementation & from interface given it is not used anywhere --------- Signed-off-by: krisselberg <kselberg@princeton.edu> Signed-off-by: peterxcli <peterxcli@gmail.com>
Description
Fix @task_consumer decorator's del method calling shutdown() which broadcasts to all Celery workers instead of just the local one. This kills newly started workers during rolling updates.
Related issues
None
Additional information
Removed self._adapter.shutdown() from del - only stop_consumer() should be called since it targets the specific worker hostname. Also removed shutdown() implementation & from interface given it is not used anywhere