Protocol Exception Host for Resumable Deterministic Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing deterministic code that communicates with external components faces challenges in handling protocol exceptions, leading to inefficient resource usage and repeated operations due to frequent restarts, especially when external queries have a high failure likelihood.
Innovation Solution
A protocol exception host manages the execution state of deterministic code, handling protocol exceptions by storing execution state objects and allowing resumption from the last successful operation, thereby avoiding redundant data retrieval and reducing resource waste.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If deterministic code is restarted after a protocol exception, then the code can be re-executed to complete the failed operation, but processing resources are wasted and previous successful operations are repeated
Solution Approach 1:
The system performs preliminary action by saving the execution state object before protocol operations are executed. This allows the system to restore to a known good state after an exception, avoiding the need to re-execute entire deterministic code blocks and wasting processing resources on already-completed operations.
Solution Approach 2:
The system discards the failed execution path and recovers by restoring from the saved execution state object. This enables the system to abandon the problematic execution sequence and resume from a previously successful state, preventing resource waste on redundant operations.
2Reliability
If deterministic code is restarted after a protocol exception, then the code can be re-executed to complete the failed operation, but redundant data retrieval operations are performed
Solution Approach 1:
The execution state object is preliminarily prepared and saved during successful operations, capturing the state after each successful data retrieval. When an exception occurs, this pre-saved state allows immediate restoration without re-executing previous data retrieval operations, eliminating redundant time consumption.
3Reliability
If deterministic code handles protocol exceptions internally, then exception handling is precise, but the code complexity increases and authoring becomes difficult
Solution Approach 1:
Exception handling functionality is extracted from the deterministic code and implemented as a separate protocol exception host mechanism. This allows deterministic code to remain simple and focused on its primary function while the host handles all exception management, including saving execution state and coordinating retries.
Solution Approach 2:
The protocol exception host acts as an intermediary between the deterministic code and the exception handling process. It receives deterministic code, monitors for protocol exceptions, saves execution state objects, and manages retries, thereby shielding the deterministic code from complexity while maintaining reliable exception handling.
4Reliability
If external queries are re-executed after failures, then data consistency can be verified, but processing resources within the external component are wasted
Solution Approach 1:
The execution state object is preliminarily saved after successful external queries, recording the state and results. When retries are needed, the system restores to this saved state and only executes the specific failed operation, avoiding redundant external queries and conserving external component resources while maintaining data consistency.
Data Source
AI summary
The handling of protocol exceptions for deterministic code that communicates with external component(s). A protocol exception host updates an execution state object associated with the deterministic code as the execution of the deterministic code proceeds. The component also detects whether a protocol exception has occurred that was caused by the deterministic code communicating using the protocol with an external component. If the component detects that such a protocol exception has occurred, the component handles the protocol exception. The component also determines whether the handled protocol exception has been successfully handled. If the exception is not successfully handled, the component stops the execution of the deterministic code such that the execution state object includes execution state of the deterministic code up to the stop. Accordingly, the execution state of the deterministic code up to the stop may be later used to resume execution of the deterministic code.


