From ff87427e49f0b176d163b8bb47c0b4c765a5ad9d 2022-05-19 22:23:04 From: MH Date: 2022-05-19 22:23:04 Subject: [PATCH] Remove unused field from port metadata --- diff --git a/src/runtime2/component/component.rs b/src/runtime2/component/component.rs index d62e12376dc8a3aad288ca6dd4688da39fd99750..5e67b69b010abe717230e2aaa1abafa39c2a9a48 100644 --- a/src/runtime2/component/component.rs +++ b/src/runtime2/component/component.rs @@ -335,7 +335,6 @@ pub(crate) fn default_handle_incoming_data_message( ) -> IncomingData { let port_handle = comp_ctx.get_port_handle(incoming_message.data_header.target_port); let port_index = comp_ctx.get_port_index(port_handle); - comp_ctx.get_port_mut(port_handle).received_message_for_sync = true; let port_value_slot = &mut inbox_main[port_index]; let target_port_id = incoming_message.data_header.target_port; @@ -595,7 +594,6 @@ pub(crate) fn default_handle_control_message( let port_info = comp_ctx.get_port(port_handle); let last_registered_round = port_info.last_registered_round; let last_instruction = port_info.last_instruction; - let port_has_had_message = port_info.received_message_for_sync; default_send_ack(message.id, peer_handle, sched_ctx, comp_ctx); comp_ctx.change_port_peer(sched_ctx, port_handle, None); @@ -612,7 +610,7 @@ pub(crate) fn default_handle_control_message( if exec_state.mode.is_in_sync_block() { let round_has_succeeded = !content.closed_in_sync_round && last_registered_round == content.registered_round; let closed_during_sync_round = content.closed_in_sync_round; - let closed_before_sync_round = ! closed_during_sync_round && !round_has_succeeded; + let closed_before_sync_round = !closed_during_sync_round && !round_has_succeeded; if (closed_during_sync_round || closed_before_sync_round) && port_was_used { return Err(( @@ -692,7 +690,6 @@ pub(crate) fn default_handle_sync_start( if let Some(message) = message { consensus.handle_incoming_data_message(comp_ctx, message); let port_info = comp_ctx.get_port_by_index_mut(port_index); - port_info.received_message_for_sync = true; } } diff --git a/src/runtime2/component/component_context.rs b/src/runtime2/component/component_context.rs index 8bf9189d82ed212972b3acfc4bf5aeecf3352fbe..49699c17ab73e742f3c3872b2ef131cb7db7885c 100644 --- a/src/runtime2/component/component_context.rs +++ b/src/runtime2/component/component_context.rs @@ -131,7 +131,6 @@ pub struct Port { // State tracking for error detection and error handling pub last_registered_round: Option, pub last_instruction: PortInstruction, // used during sync round to detect port-closed-during-sync errors - pub received_message_for_sync: bool, // used during sync round to detect port-closed-before-sync errors pub close_at_sync_end: bool, // set during sync round when receiving a port-closed-after-sync message pub(crate) associated_with_peer: bool, } @@ -185,7 +184,6 @@ impl CompCtx { last_registered_round: None, last_instruction: PortInstruction::None, close_at_sync_end: false, - received_message_for_sync: false, associated_with_peer: false, }); self.ports.push(Port{ @@ -197,7 +195,6 @@ impl CompCtx { last_registered_round: None, last_instruction: PortInstruction::None, close_at_sync_end: false, - received_message_for_sync: false, associated_with_peer: false, }); @@ -212,7 +209,6 @@ impl CompCtx { last_registered_round: None, last_instruction: PortInstruction::None, close_at_sync_end: false, - received_message_for_sync: false, associated_with_peer: false, }); return LocalPortHandle(self_id);