Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

hotfix(backend/executor): Fix RabbitMQ channel retry logic in executor (#10661)

Zamil Majdybf92e7dbc8af
diff --git a/autogpt_platform/backend/backend/executor/manager.py b/autogpt_platform/backend/backend/executor/manager.py
index c5c45c2345..cc142bacd1 100644
--- a/autogpt_platform/backend/backend/executor/manager.py
+++ b/autogpt_platform/backend/backend/executor/manager.py
@@ -1208,6 +1208,9 @@ class ExecutionManager(AppProcess):
)
return
+ # Check if channel is closed and force reconnection if needed
+ if not self.cancel_client.is_ready:
+ self.cancel_client.disconnect()
self.cancel_client.connect()
cancel_channel = self.cancel_client.get_channel()
cancel_channel.basic_consume(
@@ -1237,6 +1240,9 @@ class ExecutionManager(AppProcess):
)
return
+ # Check if channel is closed and force reconnection if needed
+ if not self.run_client.is_ready:
+ self.run_client.disconnect()
self.run_client.connect()
run_channel = self.run_client.get_channel()
run_channel.basic_qos(prefetch_count=self.pool_size)