Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More system actors and more consistent system actor naming #1649

Merged
merged 5 commits into from
Jun 4, 2022

Conversation

woksin
Copy link
Contributor

@woksin woksin commented Jun 3, 2022

Description

This PR intends to solve issues #1604 and #1603.

  • kubernetes-cluster-monitorand and IdentityStorageWorker now spawned as system actors
  • Add '$' prefix to system actor names

Purpose

This pull request is a:

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@CLAassistant
Copy link

CLAassistant commented Jun 3, 2022

CLA assistant check
All committers have signed the CLA.

@@ -36,7 +37,7 @@ public async Task SetupAsync(Cluster cluster, string[] kinds, bool isClient)
await Storage.Init();

var workerProps = Props.FromProducer(() => new IdentityStorageWorker(this));
_worker = _system.Root.Spawn(workerProps);
_worker = _system.Root.SpawnNamedSystem(workerProps, WorkerActorName);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about whether this should be a system actor. As far as I understand this worker lives alongside the IdentityStorageLookup and stops when that is stopped hence in that case it makes sense for me that this is spawn as a system actor.

@@ -196,7 +196,7 @@ internal IEndpoint GetClientEndpoint(string systemId)
private void SpawnActivator()
{
var props = Props.FromProducer(() => new Activator(_remoteConfig, _system));
ActivatorPid = _system.Root.SpawnNamedSystem(props, "activator");
ActivatorPid = _system.Root.SpawnNamedSystem(props, "$activator");
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that this change breaks the remoting tests as other places still rely on the old name.
The name could be turned into a const as for the other named actors above, e.g. $server_seed and $client_seed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't get to run the tests on my machine as I don't have the 3.1 sdk 😃 I can fix that. Though it's not comforting knowing that there are such "couplings" in the system with dependencies on actor names. Have it been a discussion point to reduce that implicit coupling by either introducing an abstraction between or having something akin to a centralized "name registry" (don't think I like this 😀 ), or something completely different

Copy link
Contributor Author

Choose a reason for hiding this comment

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

82187d7 This should resolve it

@rogeralsing
Copy link
Contributor

Very nice!
Merging this

@rogeralsing rogeralsing merged commit 2d7f16e into asynkron:dev Jun 4, 2022
@woksin woksin deleted the system-actors branch June 5, 2022 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants