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

    5 Common Mistakes When Creating Design Specs

    Web Development

    Cisco warns of ISE and CCP flaws with public exploit code

    Security

    Embracing the Present: Finding Joy in Your UX Journey

    Web Development

    How to create Google Gemini AI component in Total.js Flow

    Development

    Highlights

    MQTT5 broker for use in JUnit integration tests

    August 22, 2025

    I am trying to find an MQTT broker which is compatible with hive MQ’s Mqtt5AsyncClient, for integration test purposes.
    I am writing tests using JUnit, and have tried moquette but that appears (for now) to only support MQTT v3, not v5.
    Does anyone know of an embedded (i.e. can be run through java code directly) MQTT broker which I could use in this scenario?

    Accelerate enterprise AI implementations with Amazon Q Business

    August 22, 2025

    New Linux Flaws Enable Full Root Access via PAM and Udisks Across Major Distributions

    June 27, 2025

    Enhanced Enum Processing with Laravel’s Default Parameter Support

    June 27, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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