Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Silent Failure #20: The Stop Button Cancelled a Handle That Was Already None

The last line in my soak log was reconcile after stop: [['a.py']] . The service had been stopped two seconds earlier. The watcher was supposed to be gone, the debounce was supposed to be cancelled, and the reconciler was still walking the tree and printing the file it had picked up. The test I wrote for that exact path was green. That is the part that still stings. I have been fixing lifecycle…

The story describes a bug discovered in the magitech-ai/anima 2.0 service, which watches files and reloads fibers. The bug occurred when a shutdown request was issued, causing the service to stop prematurely and wake up later with a stashed change, leading to a failed reconciliation. The issue arose because the service cancelled a handle that had been set to None since the watch was installed, causing the flush to wake up unexpectedly and call reconcile() unexpectedly.

The bug was caught by a test that printed the input list of every reconcile, revealing a file in the list after stop. The fix was to give the flush task its own slot, self._fs_flush_task, and cancel it through _cancel_fs_flush() in both the stop() and the side-effect disposer. The change was straightforward but still a mistake, as the correct pattern was three lines above the code being edited.

The fix included adding a test that captured the disposer actually held by the service, called it, and asserted the live task was cancelled. The author also warns against testing the canceller with a task made up in the test, suggesting instead to register the watch, capture the disposer, call it, and assert the live task is cancelled.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Batch EXIF Removal in the Browser: What Gets Stripped and What the Re-Encode Costs

Batch EXIF Removal in the Browser: What Gets Stripped and What the Re-Encode Costs Batch image processing for EXIF removal means redrawing each photo onto a canvas and re-encoding it, which drops…

  • Batch processing removes EXIF metadata by re-encoding images
  • Browser tool SmartImgKit handles JPG, PNG, and WebP formats
  • Re-encoding step incurs measurable cost, with fixed JPEG quality at 92%

Building a Zero-Dependency 1200x750 WebP Infographic & SERP Studio with HTML5 Canvas and PHP GD

Starting a modern content-heavy WordPress build often hits the same Core Web Vitals bottleneck: editors upload oversized 2400x1600 PNGs or rely on heavy SaaS image APIs, hurting Largest Contentful…

  • Zero-dependency WebP infographics built with HTML5 Canvas and PHP GD
  • 1200x750 aspect ratio ensures zero layout shift and fast loading
  • Browser and server-side rendering support for WordPress sites

Your Next.js Deployment Passed. Here Is What It Did Not Verify.

Your deployment passed. Green checkmark, live URL, everything looks fine. Then a user messages you at midnight. Something is broken, and it has been broken since the deploy. Not the build.

  • Deployment passed with green checkmark and live URL
  • Pipeline verifies build start, not production safety
  • SaaS Post Deploy Safety Kit checks safety after deployment

More from Monday, 30 November 2026 →