<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Obinna Victor</title>
    <description>The latest articles on DEV Community by Obinna Victor (@sopuruchii).</description>
    <link>https://dev.to/sopuruchii</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3958363%2F3ad1f999-7860-4e9a-861a-3c6ca445179c.jpg</url>
      <title>DEV Community: Obinna Victor</title>
      <link>https://dev.to/sopuruchii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sopuruchii"/>
    <language>en</language>
    <item>
      <title>Why I treat API timeouts as "unknown", not failures</title>
      <dc:creator>Obinna Victor</dc:creator>
      <pubDate>Fri, 29 May 2026 12:23:31 +0000</pubDate>
      <link>https://dev.to/sopuruchii/why-i-treat-api-timeouts-as-unknown-not-failures-509a</link>
      <guid>https://dev.to/sopuruchii/why-i-treat-api-timeouts-as-unknown-not-failures-509a</guid>
      <description>&lt;p&gt;Every payment gateway I've ever worked on had the same hidden bug.&lt;/p&gt;

&lt;p&gt;A provider API times out. The code says "failure". So you retry. But the original request actually succeeded – the provider just took too long to respond. Now you've double‑charged the customer.&lt;/p&gt;

&lt;p&gt;I built &lt;code&gt;Azums&lt;/code&gt;, an open‑source payment gateway in Rust, specifically to stop this pattern.&lt;/p&gt;

&lt;p&gt;_&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;_The fix: make ambiguity explicit.&lt;/p&gt;

&lt;p&gt;Instead of &lt;code&gt;pending → success/fail&lt;/code&gt;, I designed a state machine with five states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pending&lt;/code&gt; (request sent, waiting)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;succeeded&lt;/code&gt; (confirmed success)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;failed&lt;/code&gt; (confirmed failure)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;retryable&lt;/code&gt; (temporary error, safe to retry)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;unknown&lt;/code&gt;&lt;/strong&gt; (timeout or ambiguous response – needs investigation)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a timeout happens, the system doesn't guess. It marks the transaction as &lt;code&gt;unknown&lt;/code&gt; and stops. No blind retries. No double charges.&lt;/p&gt;

&lt;p&gt;Why this matters beyond payments&lt;/p&gt;

&lt;p&gt;This same pattern applies anywhere you talk to unreliable external systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blockchain RPCs that timeout after the transaction was submitted&lt;/li&gt;
&lt;li&gt;AI agent API calls that hang but may have executed&lt;/li&gt;
&lt;li&gt;Messaging queues that lose acknowledgements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Treating ambiguity as a real state is the difference between a system that guesses and a system that you can trust.&lt;/p&gt;

&lt;p&gt;My full implementation is on GitHub: &lt;a href="https://github.com/BlockForge-Dev/Azums" rel="noopener noreferrer"&gt;BlockForge-Dev/Azums&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What's your worst "timeout caused a disaster" story? Let me know in the comments.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>distributedsystems</category>
      <category>sre</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
