Files
doc-exports/docs/fg/umn/functiongraph_01_1814.html
liusiying01 904c1aad8b FG UMN 20250526 version
Reviewed-by: Mützel, Andrea <andrea.muetzel@t-systems.com>
Co-authored-by: liusiying01 <liusiying@huawei.com>
Co-committed-by: liusiying01 <liusiying@huawei.com>
2025-10-06 15:14:20 +00:00

20 lines
2.9 KiB
HTML

<a name="functiongraph_01_1814"></a><a name="functiongraph_01_1814"></a>
<h1 class="topictitle1">Retry Mechanism</h1>
<div id="body8662426"><p id="functiongraph_01_1814__en-us_topic_0000001251748184_p121903554103">If synchronous or asynchronous invocation fails, do as follows:</p>
<ul id="functiongraph_01_1814__en-us_topic_0000001251748184_ul150012461413"><li id="functiongraph_01_1814__en-us_topic_0000001251748184_li145001460411">Synchronous invocation<p id="functiongraph_01_1814__en-us_topic_0000001251748184_p138588111514"><a name="functiongraph_01_1814__en-us_topic_0000001251748184_li145001460411"></a><a name="en-us_topic_0000001251748184_li145001460411"></a>Try again.</p>
</li><li id="functiongraph_01_1814__en-us_topic_0000001251748184_li1048461416612">Asynchronous invocation<p id="functiongraph_01_1814__en-us_topic_0000001251748184_p79917461061"><a name="functiongraph_01_1814__en-us_topic_0000001251748184_li1048461416612"></a><a name="en-us_topic_0000001251748184_li1048461416612"></a>You can set the maximum number of retries and the maximum message validity period (up to 24 hours) by referring to <a href="functiongraph_01_0390_03.html#functiongraph_01_0390_03">Configuring Asynchronous Notification Policy</a>. FunctionGraph will retry a function based on these two parameters.</p>
</li></ul>
<div class="section" id="functiongraph_01_1814__en-us_topic_0000001251748184_section594012512183"><h4 class="sectiontitle">Idempotency</h4><p id="functiongraph_01_1814__en-us_topic_0000001251748184_p8060118">In programming, idempotency means that an application or component can identify duplicate events and prevent duplication, inconsistency, and data loss. If you want to keep a function idempotent, you need to design the function logic to correctly handle repeated events.</p>
<p id="functiongraph_01_1814__en-us_topic_0000001251748184_p1337192410137">Idempotent function logic helps reduce the following problems:</p>
<ul id="functiongraph_01_1814__en-us_topic_0000001251748184_ul121791541171316"><li id="functiongraph_01_1814__en-us_topic_0000001251748184_li11179241201316">Unnecessary API calls</li><li id="functiongraph_01_1814__en-us_topic_0000001251748184_li67839435138">Code processing time</li><li id="functiongraph_01_1814__en-us_topic_0000001251748184_li1335518452133">Data inconsistency</li><li id="functiongraph_01_1814__en-us_topic_0000001251748184_li106541446131312">Restrictions</li><li id="functiongraph_01_1814__en-us_topic_0000001251748184_li10256104911130">Latency</li></ul>
<p id="functiongraph_01_1814__en-us_topic_0000001251748184_p15831848171419">Ensure that your function code can process the same event multiple times without causing duplicate transactions or other unnecessary side effects in case of abnormal calls, retry of client, or retry within dependent functions.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="functiongraph_01_0160.html">Invoking the Function</a></div>
</div>
</div>