Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Conversation

@mattjohnsonpint
Copy link
Contributor

When starting the actor system we restore agents that were suspended. This shuffles the list retrieved from the database, which has the effect of distributing the actors across multiple nodes, if multiple nodes are being started simultaneously.

@mattjohnsonpint mattjohnsonpint requested review from a team and Copilot June 24, 2025 03:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an improvement to distribute actor restoration across cluster nodes on startup by shuffling the list of restored agents.

  • Introduces a new asynchronous restoreAgentActors function for querying and shuffling agents.
  • Replaces the local agent map with an ActorExists check to prevent duplicate actor spawns.
  • Updates the CHANGELOG with a new feature entry.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
runtime/actors/actorsystem.go Refactors actor restoration by shuffling agents and handling spawning logic, replacing a local map check with an ActorExists verification.
CHANGELOG.md Adds an entry for the new feature.
Comments suppressed due to low confidence (1)

runtime/actors/actorsystem.go:95

  • [nitpick] With the removal of the localAgents map and usage of _actorSystem.ActorExists to check for running actors, please ensure that ActorExists covers all necessary cases to prevent duplicate actor spawns.
	actors := _actorSystem.Actors()

@mattjohnsonpint mattjohnsonpint enabled auto-merge (squash) June 24, 2025 03:11
@mattjohnsonpint mattjohnsonpint merged commit 470fd91 into main Jun 24, 2025
33 checks passed
@mattjohnsonpint mattjohnsonpint deleted the mjp/restore-randomly branch June 24, 2025 03:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants