Skip to content

Handle notifications as retry events in the invoker #3177

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

Merged
merged 2 commits into from
Apr 18, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions crates/invoker-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ where
self.handle_completion(partition, invocation_id, completion);
},
InputCommand::Notification { partition, invocation_id, notification } => {
self.handle_notification(partition, invocation_id, notification);
self.handle_notification(options, partition, invocation_id, notification);
},
InputCommand::StoredCommandAck { partition, invocation_id, command_index } => {
self.handle_stored_command_ack(options, partition, invocation_id, command_index);
Expand Down Expand Up @@ -868,24 +868,20 @@ where
)]
fn handle_notification(
&mut self,
options: &InvokerOptions,
partition: PartitionLeaderEpoch,
invocation_id: InvocationId,
notification: RawNotification,
) {
if let Some((_, ism)) = self
.invocation_state_machine_manager
.resolve_invocation(partition, &invocation_id)
{
self.handle_retry_event(options, partition, invocation_id, |ism| {
trace!(
restate.invocation.target = %ism.invocation_target,
restate.journal.ty = %notification.ty(),
"Sending entry"
);

ism.notify_entry(RawEntry::new(RawEntryHeader::default(), notification));
} else {
// If no state machine is registered, the PP will send a new invoke
trace!("No state machine found for given completion");
}
});
}

#[instrument(
Expand Down
Loading