Skip to content

Commit

Permalink
Without this commit adding {} brackets, these log lines are not shown!
Browse files Browse the repository at this point in the history
Might be a compiler bug or some stuff like that 🤷
  • Loading branch information
slinkydeveloper committed Nov 15, 2024
1 parent bb522b7 commit b2c22d0
Showing 1 changed file with 49 additions and 38 deletions.
87 changes: 49 additions & 38 deletions crates/worker/src/partition/state_machine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2811,17 +2811,21 @@ impl<Codec: RawEntryCodec> StateMachine<Codec> {
response: IngressResponseResult,
) {
match &response {
IngressResponseResult::Success(_, _) => debug_if_leader!(
ctx.is_leader,
"Send response to ingress with request id '{:?}': Success",
request_id
),
IngressResponseResult::Failure(e) => debug_if_leader!(
ctx.is_leader,
"Send response to ingress with request id '{:?}': Failure({})",
request_id,
e
),
IngressResponseResult::Success(_, _) => {
debug_if_leader!(
ctx.is_leader,
"Send response to ingress with request id '{:?}': Success",
request_id
)
}
IngressResponseResult::Failure(e) => {
debug_if_leader!(
ctx.is_leader,
"Send response to ingress with request id '{:?}': Failure({})",
request_id,
e
)
}
};

ctx.action_collector.push(Action::IngressResponse {
Expand Down Expand Up @@ -2973,15 +2977,17 @@ impl<Codec: RawEntryCodec> StateMachine<Codec> {
message: OutboxMessage,
) -> Result<(), Error> {
match &message {
OutboxMessage::ServiceInvocation(service_invocation) => debug_if_leader!(
ctx.is_leader,
rpc.service = %service_invocation.invocation_target.service_name(),
rpc.method = %service_invocation.invocation_target.handler_name(),
restate.invocation.id = %service_invocation.invocation_id,
restate.invocation.target = %service_invocation.invocation_target,
restate.outbox.seq = seq_number,
"Effect: Send service invocation to partition processor"
),
OutboxMessage::ServiceInvocation(service_invocation) => {
debug_if_leader!(
ctx.is_leader,
rpc.service = %service_invocation.invocation_target.service_name(),
rpc.method = %service_invocation.invocation_target.handler_name(),
restate.invocation.id = %service_invocation.invocation_id,
restate.invocation.target = %service_invocation.invocation_target,
restate.outbox.seq = seq_number,
"Effect: Send service invocation to partition processor"
)
}
OutboxMessage::ServiceResponse(InvocationResponse {
result: ResponseResult::Success(_),
entry_index,
Expand All @@ -2995,25 +3001,29 @@ impl<Codec: RawEntryCodec> StateMachine<Codec> {
entry_index
)
}
OutboxMessage::InvocationTermination(invocation_termination) => debug_if_leader!(
ctx.is_leader,
restate.invocation.id = %invocation_termination.invocation_id,
restate.outbox.seq = seq_number,
"Effect: Send invocation termination command '{:?}' to partition processor",
invocation_termination.flavor
),
OutboxMessage::InvocationTermination(invocation_termination) => {
debug_if_leader!(
ctx.is_leader,
restate.invocation.id = %invocation_termination.invocation_id,
restate.outbox.seq = seq_number,
"Effect: Send invocation termination command '{:?}' to partition processor",
invocation_termination.flavor
)
}
OutboxMessage::ServiceResponse(InvocationResponse {
result: ResponseResult::Failure(e),
entry_index,
id,
}) => debug_if_leader!(
ctx.is_leader,
restate.invocation.id = %id,
restate.outbox.seq = seq_number,
"Effect: Send failure '{}' response to another invocation, completing entry index {}",
e,
entry_index
),
}) => {
debug_if_leader!(
ctx.is_leader,
restate.invocation.id = %id,
restate.outbox.seq = seq_number,
"Effect: Send failure '{}' response to another invocation, completing entry index {}",
e,
entry_index
)
}
OutboxMessage::AttachInvocation(AttachInvocationRequest {
invocation_query, ..
}) => {
Expand Down Expand Up @@ -3515,9 +3525,10 @@ impl<Codec: RawEntryCodec> StateMachine<Codec> {
service_id: ServiceId,
) -> Result<(), Error> {
debug_if_leader!(
ctx.is_leader,
rpc.service = %service_id.service_name,
"Effect: Clear all promises");
ctx.is_leader,
rpc.service = %service_id.service_name,
"Effect: Clear all promises"
);

ctx.storage.delete_all_promises(&service_id).await;

Expand Down

0 comments on commit b2c22d0

Please sign in to comment.