Skip to content

Commit

Permalink
Do not respond to Spawn command if node_id is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
kosticmarin committed Oct 3, 2023
1 parent c1b3587 commit 1c106db
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions crates/lunatic-distributed/src/distributed/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,19 @@ where
match handle_spawn(ctx.clone(), spawn).await {
Ok(Ok(id)) => {
log::trace!("lunatic::distributed::server Spawned {id}");
ctx.node_client
.send_response(ResponseParams {
node_id: NodeId(node_id),
response: Response {
message_id: msg_id,
content: ResponseContent::Spawned(id),
},
})
.await?;
// The platform sends the spawn instructions with node_id = 0
// in this case we do not respond
if node_id != 0 {
ctx.node_client
.send_response(ResponseParams {
node_id: NodeId(node_id),
response: Response {
message_id: msg_id,
content: ResponseContent::Spawned(id),
},
})
.await?;
}
}
Ok(Err(client_error)) => {
log::trace!("lunatic::distributed::server Spawn error: {client_error:?}");
Expand Down

0 comments on commit 1c106db

Please sign in to comment.