Skip to content

chore: simplify actor's context#1955

Open
SantiagoPittella wants to merge 6 commits intonextfrom
santiagopittella-simplify-actor-context
Open

chore: simplify actor's context#1955
SantiagoPittella wants to merge 6 commits intonextfrom
santiagopittella-simplify-actor-context

Conversation

@SantiagoPittella
Copy link
Copy Markdown
Collaborator

closes #1889

@SantiagoPittella SantiagoPittella added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Apr 17, 2026
Copy link
Copy Markdown
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

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

Looks good, barring the notify change

Comment thread crates/ntx-builder/src/coordinator.rs Outdated
Copy link
Copy Markdown
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Copy Markdown
Collaborator

@igamigo igamigo left a comment

Choose a reason for hiding this comment

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

LGTM, left some minor comments/questions

Comment thread crates/ntx-builder/src/coordinator.rs Outdated
Comment on lines +391 to +397
_ = tokio::time::sleep(self.config.idle_timeout) => {
tracing::info!(
%account_id,
"Account actor deactivated while waiting for account commit",
);
return Ok(false);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mostly asking to fully understand this change: Previously, the cancel token flow would wait indefinitely, right? If so, what is the motivation for it? I'm wondering if there is any new scenario where an actor could exit and later misses notifications

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Previously, the cancel token flow would wait indefinitely, right?

Yes

what is the motivation for it? I'm wondering if there is any new scenario where an actor could exit and later misses notifications

Notifications can't be missed, the has_pending_notification handshake in the coordinator catches this

Comment on lines +178 to 184
if self.actor_registry.contains_key(&account_id) {
tracing::error!(
account_id = %account_id,
"Account actor already exists"
);
handle.cancel_token.cancel();
return;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should the existing actor in the registry be notified here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hmm I'm not sure about this. why?

Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify actor context

3 participants