<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Maharshi Shukla on Medium]]></title>
        <description><![CDATA[Stories by Maharshi Shukla on Medium]]></description>
        <link>https://medium.com/@maharshi_shukla?source=rss-34a636f8916c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Mm-x0Y3Ic9THSmcULRtneA.jpeg</url>
            <title>Stories by Maharshi Shukla on Medium</title>
            <link>https://medium.com/@maharshi_shukla?source=rss-34a636f8916c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 14:00:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@maharshi_shukla/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When Correct Code Isn’t Enough: Lessons from a Service Mesh Incident]]></title>
            <link>https://medium.com/@maharshi_shukla/when-correct-code-isnt-enough-lessons-from-a-service-mesh-incident-885e4c2a71d7?source=rss-34a636f8916c------2</link>
            <guid isPermaLink="false">https://medium.com/p/885e4c2a71d7</guid>
            <category><![CDATA[kuma]]></category>
            <category><![CDATA[service-mesh]]></category>
            <dc:creator><![CDATA[Maharshi Shukla]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 11:16:03 GMT</pubDate>
            <atom:updated>2026-03-18T11:25:45.881Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever said <em>“but it works locally”</em> and still watched things break in production, this story might feel familiar.</p><h3>The Three Minutes That Changed How I See Systems</h3><p>It wasn’t even a direct deployment.</p><p>My change was just one small piece of a larger end-to-end flow — the kind that quietly moves across multiple services and usually works without anyone thinking too much about it. From where I stood, everything looked fine.</p><p>At the time, I was a new SDE intern, still trying to understand how systems behave outside my local environment. The change felt safe. It had already passed L0–L1 reviews. Nothing about it suggested trouble.</p><p>Then the flow got triggered.<br>Within seconds, pager alerts started going off.<br>At first, I ignored them. It didn’t seem related. But the alerts kept coming. Requests were failing somewhere in the middle of the flow. Services weren’t communicating the way they should.<br>Something was clearly wrong.<br>And then it hit me — this was because of my change.<br>Not because the code was incorrect.<br>But because somewhere along that flow, I had violated a service mesh rule.<br>For about three minutes, things kept failing before stabilizing.</p><p>Three minutes doesn’t sound like much. But when alerts are firing and you’re scrambling to figure out what just broke, it feels a lot longer.</p><h3>What I Didn’t Understand Back Then</h3><p>At that point, my mental model was simple:</p><blockquote><em>If the code is correct, things should work.</em></blockquote><p>That’s how most of us start.<br>What I hadn’t fully grasped yet was this:</p><blockquote><em>In a microservices architecture, your code doesn’t run in isolation.</em></blockquote><p>It runs inside a system with its own rules — and those rules matter just as much as your logic.<br>In my case, those rules were enforced by Kuma.</p><h3>So, What Is Kuma (Without the Buzzwords)?</h3><p>Think of Kuma as a layer that sits between services and controls how they communicate.<br>Instead of each service worrying about:</p><ul><li>who it can call</li><li>how retries work</li><li>how communication is secured</li></ul><p>Kuma handles all of that.<br>Your service still makes requests like usual. But in between, Kuma is quietly asking:</p><ul><li><em>Is this allowed?</em></li><li><em>Should this request go through?</em></li></ul><p>And if the answer is no, the request simply stops there.</p><h3>What Actually Went Wrong</h3><p>As part of my change, I introduced a call from one service to another.</p><p>From my perspective:</p><ul><li>The API contract was correct</li><li>The logic made sense</li><li>The overall flow looked fine</li></ul><p>But there was one thing I didn’t know.<br>Kuma had a rule that said something like:</p><blockquote><em>This service is not allowed to talk to that service.</em></blockquote><p>So it blocked the request.<br>Because this wasn’t an isolated call — but part of a chain reaction — the failure propagated:</p><ul><li>One service didn’t receive data</li><li>Another couldn’t proceed</li><li>Eventually, the system raised alerts</li></ul><p>Nothing random happened.<br>The system behaved exactly as it was designed to.</p><h3>The Part I Missed (And Wish I Knew Earlier)</h3><p>The issue wasn’t in the code.<br>It was in the policies.</p><h3>L4 — The Basic Gate</h3><p>This layer answers a simple question:</p><blockquote><em>Can service A talk to service B.</em></blockquote><p>If the answer is no, the request never even reaches its destination.<br>In Kuma, this is controlled through something like <strong>TrafficPermission</strong>.<br>In my case, that permission didn’t exist.</p><h3>L7 — The Detailed Control</h3><p>Even if communication is allowed, there’s another layer that defines <em>how</em> it happens:</p><ul><li>which API paths are accessible</li><li>retries and timeouts</li><li>routing behavior</li></ul><p>So in simple terms:</p><ul><li><strong>L4 = can you talk</strong></li><li><strong>L7 = how you talk</strong></li></ul><p>I never made it past L4.</p><h3>What I Should Have Done</h3><p>Looking back, the steps feel obvious. At the time, they weren’t.</p><p>I should have:</p><ul><li>thought about the entire flow, not just my service</li><li>checked whether the new interaction was allowed</li><li>updated the necessary TrafficPermission policies</li><li>tested the flow before triggering it</li></ul><p>But my thinking was limited to code.<br>Not the system around it.</p><h3>Why Kuma Felt Annoying (But Was Actually Right)</h3><p>In the moment, it felt like Kuma was just getting in the way.<br>But it wasn’t.<br>It follows a very simple principle:</p><blockquote><em>If it’s not explicitly allowed, it won’t happen.</em></blockquote><p>And honestly, that’s a good thing.<br>It prevents:</p><ul><li>accidental access</li><li>hidden dependencies</li><li>unclear service boundaries</li></ul><p>It forces you to be explicit about how services interact.</p><h3>What Changed for Me</h3><p>After that incident, something small — but important — shifted in how I think.</p><p>Before:</p><blockquote><em>“My code is correct, so it should work.”</em></blockquote><p>Now:</p><blockquote><em>“My code is correct… but is this interaction allowed by the system?”</em></blockquote><p>That question didn’t exist for me earlier.<br>Now, it’s always there.</p><h3>Final Thought</h3><p>Those three minutes weren’t fun — especially as an intern.<br>But they were valuable.<br>Because they made one thing very clear:</p><blockquote><em>In microservices, writing correct code is not enough.</em></blockquote><p>Your code has to operate within a system that already has rules.<br>And sometimes, things don’t fail because your logic is wrong.<br>They fail because you assumed you were allowed to do something — when you weren’t.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=885e4c2a71d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static Code Analyser: Catching Simple Mistakes Before They Become Production Noise]]></title>
            <link>https://medium.com/@maharshi_shukla/static-code-analyser-catching-simple-mistakes-before-they-become-production-noise-09f861241f76?source=rss-34a636f8916c------2</link>
            <guid isPermaLink="false">https://medium.com/p/09f861241f76</guid>
            <category><![CDATA[exception-handling]]></category>
            <category><![CDATA[static-code-analysis]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Maharshi Shukla]]></dc:creator>
            <pubDate>Wed, 11 Feb 2026 17:19:50 GMT</pubDate>
            <atom:updated>2026-03-27T05:58:04.564Z</atom:updated>
            <content:encoded><![CDATA[<p>In modern software development, teams move fast. Features are released quickly, services are interconnected, and monitoring systems generate massive amounts of logs. In such an environment, even a small coding oversight can create large production noise and consume valuable engineering time.</p><p>One effective way to reduce such issues is <strong>static code analysis -</strong>a simple but powerful engineering practice that helps detect problems before code is executed.</p><h3>A Small Story From Real Engineering Life</h3><p>Last month, I spent hours investigating a noisy exception that kept appearing in DataDog. It looked serious because of how frequently it was being logged. At first glance, it felt like data inconsistency, maybe service contract mismatch, or maybe something wrong in upstream flow.</p><p>But the actual reason was surprisingly simple.</p><p>We were iterating over an error variable <strong>without checking whether it was null or not</strong>.</p><p>In PHP, iterating over null throws an <em>invalid argument</em> error. If the same variable was an empty array ([]), everything would have worked fine. But because it was null, it kept generating exceptions and filling monitoring dashboards with noise.</p><p>Since I was new to both the language and the codebase, I could not assume anything. I had to:</p><ul><li>Trace multiple service flows</li><li>Verify behaviour using traces</li><li>Ensure any fix would not break existing flows</li><li>Double check production safety</li></ul><p>The debugging took hours. Not because the problem was complex, but because it was hidden behind runtime behaviour.</p><p>Later, while reflecting on it, one thing became very clear.</p><p><strong>This entire issue could have been caught by static code analysis in the CI/CD pipeline.</strong></p><h3>What is a Static Code Analyser? (Simple Definition)</h3><p>A <strong>static code analyser</strong> is a tool that scans your source code <strong>without running it</strong> and finds possible issues.</p><p>It can detect:</p><ul><li>Missing null checks</li><li>Unsafe iterations</li><li>Wrong type assumptions</li><li>Risky coding patterns</li><li>Code standard violations</li></ul><p>Instead of waiting for runtime errors or monitoring alerts, static analysis flags problems during development or CI validation.</p><h3>How Static Analysis Could Have Prevented My Issue</h3><p>In our case, return types were defined as mixed. That meant the value could be anything — array, object, null, or something else. Because of this, I had to manually verify all possible paths.</p><p>If static rules were stricter, like:</p><ul><li>Restricting unnecessary use of mixed</li><li>Enforcing explicit nullable types</li><li>Warning when iterating over possibly null variables</li></ul><p>Then this issue would have been caught before deployment.</p><h3>Why Static Code Analysis Matters in Collaborative Teams</h3><p>In team environments, developers write code with different assumptions. Without common safety rules, small issues slip through and become runtime surprises.</p><p>Static analysis helps by:</p><ul><li><strong>Creating Common Coding Patterns </strong>— Everyone follows the same safety standards.</li><li><strong>Reducing Debugging Effort -</strong>Issues are caught before runtime.</li><li><strong>Helping New Developers </strong>— Less dependency on hidden codebase knowledge.</li><li><strong>Reducing Monitoring Noise -</strong>Only real issues reach production logs.</li></ul><h3>Where Static Code Analysis Fits in CI/CD Pipeline</h3><p>Static analysis works best when integrated at multiple levels.</p><ol><li><strong>Developer Level (Local Development)</strong></li></ol><p>Runs before commit using:</p><ul><li>IDE plugins</li><li>Pre-commit hooks</li></ul><p>Prevents basic mistakes early.</p><p>2. <strong>CI / Pull Request Stage (Most Important)<br></strong>Typical Flow:</p><pre>Code Push<br>   ↓<br>Static Code Analysis<br>   ↓<br>Unit Tests<br>   ↓<br>Build<br>   ↓<br>Deploy</pre><p>If static analysis fails → Merge is blocked.<br>This ensures unsafe code never reaches main branches.</p><p><strong>3. Build Stage<br></strong>Acts as a second safety layer to ensure no rule bypass happens.</p><h3>Final Thoughts</h3><p>I learned from that debugging experience that many production problems are not the result of complicated system failures, but rather of minor safety precautions that were overlooked during development. In order to save debugging time, minimize monitoring noise, and free up engineers to concentrate more on creating dependable features, static code analysis assists in moving these checks earlier in the lifecycle, from production to CI and then to development. Static code analysis is becoming a fundamental necessity for creating reliable and maintainable software in contemporary collaborative settings, not just a good practice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09f861241f76" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>