Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Error’d: Pickup Sticklers

      September 27, 2025

      From Prompt To Partner: Designing Your Custom AI Assistant

      September 27, 2025

      Microsoft unveils reimagined Marketplace for cloud solutions, AI apps, and more

      September 27, 2025

      Design Dialects: Breaking the Rules, Not the System

      September 27, 2025

      Building personal apps with open source and AI

      September 12, 2025

      What Can We Actually Do With corner-shape?

      September 12, 2025

      Craft, Clarity, and Care: The Story and Work of Mengchu Yao

      September 12, 2025

      Cailabs secures €57M to accelerate growth and industrial scale-up

      September 12, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Using phpinfo() to Debug Common and Not-so-Common PHP Errors and Warnings

      September 28, 2025
      Recent

      Using phpinfo() to Debug Common and Not-so-Common PHP Errors and Warnings

      September 28, 2025

      Mastering PHP File Uploads: A Guide to php.ini Settings and Code Examples

      September 28, 2025

      The first browser with JavaScript landed 30 years ago

      September 27, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured
      Recent
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Going Crazy

    CodeSOD: Going Crazy

    August 18, 2025

    For months, everything at Yusuf‘s company was fine. Then, suddenly, he comes in to the office to learn that overnight the log exploded with thousands of panic messages. No software changes had been pushed, no major configurations had happened- just a reboot. What had gone wrong?

    This particular function was invoked as part of the application startup:

    <span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(a *App)</span></span> setupDocDBClient(ctx context.Context) <span class="hljs-type">error</span> {
    	docdbClient, err := docdb.NewClient(
    		ctx,
    		a.config.MongoConfig.URI,
    		a.config.MongoConfig.Database,
    		a.config.MongoConfig.EnableTLS,
    	)
    	<span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> {
    		<span class="hljs-keyword">return</span> <span class="hljs-literal">nil</span>
    	}
    
    	a.DocDBClient = docdbClient
    	<span class="hljs-keyword">return</span> <span class="hljs-literal">nil</span>
    }
    

    This is Go, which passes errors as part of the return. You can see an example where docdb.NewClient returns a client and an err object. At one point in the history of this function, it did the same thing- if connecting to the database failed, it returned an error.

    But a few months earlier, an engineer changed it to swallow the error- if an error occurred, it would return nil.

    As an organization, they did code reviews. Multiple people looked at this and signed off- or, more likely, multiple people clicked a button to say they’d looked at it, but hadn’t.

    Most of the time, there weren’t any connection issues. But sometimes there were. One reboot had a flaky moment with connecting, and the error was ignored. Later on in execution, downstream modules started failing, which eventually led to a log full of panic level messages.

    The change was part of a commit tagged merely: “Refactoring”. Something got factored, good and hard, all right.

    [Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleYour smart home device just got a performance and security boost for free
    Next Article 3D Layered Text: The Basics

    Related Posts

    News & Updates

    Building personal apps with open source and AI

    September 12, 2025
    News & Updates

    What Can We Actually Do With corner-shape?

    September 12, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Creating The “Moving Highlight” Navigation Bar With JavaScript And CSS

    Tech & Work

    Your Wemo smart devices are about to get dumb as Belkin pulls the plug

    News & Updates

    Ivanti Zero-Days Exploited to Drop MDifyLoader and Launch In-Memory Cobalt Strike Attacks

    Security

    3D Layered Text: The Basics

    News & Updates

    Highlights

    I tested a compact power station with a solar power generator – it’s my new travel essential

    July 2, 2025

    EcoFlow’s Delta 3 Plus builds on its predecessor with expandable capacity – a rare but…

    Microsoft Patch Tuesday June 2025: One Zero-Day, Nine High-risk Flaws Fixed

    June 11, 2025

    Report: Security is no longer the top challenge in cloud native environments

    April 1, 2025

    Creating a JavaScript Debugging Utility to Guard Noisy Production Consoles

    September 3, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.