From 55752b263fead435624fa82117d85c6dbd02ff60 Mon Sep 17 00:00:00 2001 From: Olivier Le Thanh Duong Date: Tue, 8 Oct 2024 14:18:25 +0200 Subject: [PATCH] Fix: Error fetching message from vm-connector for start_watch_for_messages_task Jira ticket : ALEPH-111 Problem: When aleph-vm was starting if the vm-connector couldn't connect to the pyaleph API , the startup crashed and systemd restarted it in a loop. Solution: Stop registering the sample program at startup, so the pyaleph api don't need to be reached at startup. This code was left as a demo but it didn't really do anything at the moment. We have just commented the code if we want to reuse it in the future. Note: A more complete and long analysis of the problem, along with propsed solution is on the JIRA ticket https://aleph-im.atlassian.net/browse/ALEPH-111?focusedCommentId=10008 --- src/aleph/vm/orchestrator/tasks.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/aleph/vm/orchestrator/tasks.py b/src/aleph/vm/orchestrator/tasks.py index 99c814a8..c7062d93 100644 --- a/src/aleph/vm/orchestrator/tasks.py +++ b/src/aleph/vm/orchestrator/tasks.py @@ -123,12 +123,12 @@ async def start_watch_for_messages_task(app: web.Application): # Register an hardcoded initial program # TODO: Register all programs with subscriptions - sample_message, _ = await load_updated_message( - ref=ItemHash("cad11970efe9b7478300fd04d7cc91c646ca0a792b9cc718650f86e1ccfac73e") - ) - if isinstance(sample_message, ProgramMessage): - assert sample_message.content.on.message, sample_message - reactor.register(sample_message) + # sample_message, _ = await load_updated_message( + # ref=ItemHash("cad11970efe9b7478300fd04d7cc91c646ca0a792b9cc718650f86e1ccfac73e") + # ) + # if isinstance(sample_message, ProgramMessage): + # assert sample_message.content.on.message, sample_message + # reactor.register(sample_message) app["pubsub"] = pubsub app["reactor"] = reactor