Skip to content

Commit

Permalink
Fix: Error fetching message from vm-connector for start_watch_for_mes…
Browse files Browse the repository at this point in the history
…sages_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
  • Loading branch information
olethanh committed Oct 10, 2024
1 parent 49d91d2 commit 2dfb42b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/aleph/vm/orchestrator/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2dfb42b

Please sign in to comment.