Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why "Delete This" Messages Sometimes Never Arrive

Think about a hostel or PG. When you check out, you're supposed to tell the warden, and the warden marks your room as free. Simple system. Works fine until the day it doesn't. Say you check out in a hurry. You mean to tell the warden, but you get a call, you rush off, and you forget. Now here's the problem: the warden still thinks you're in that room. Nobody told them otherwise. The room sits…

In a hostel or PG, when you check out, you are supposed to inform the warden, who then marks your room as available. This simple system works well until it fails. Imagine you leave in a rush, meaning to tell the warden, but you get a call and rush off, forgetting. The warden remains unaware that the room is now free. New students may come looking for a room, only to be told there are no vacancies, even though the room is empty. The same issue occurs in software systems.

Most software systems follow a "tell them" approach, where when you finish using a resource like a server, slot, or seat, you tell the system to release it. This is called a push, as you push a message saying "I'm done, release me." The system works most of the time, but it has a hidden weakness. It only functions if the message arrives.

What if the app crashes before sending the message, the network glitches for a second, or the other system is overwhelmed and drops the message? These scenarios are not uncommon in a busy system. When this happens, you end up with an occupied resource still marked as in use, even though it is free. This situation persists indefinitely because the system has no way to know it should be freed.

The problem is subtle to detect. The occupied resource appears fine when viewed from the outside. It isn't crashing, isn't slow, and doesn't exhibit any obvious issues. Your initial assumption is likely to be that the system is correct, as the dashboard indicates it is full. However, the dashboard may be repeating a lie that has never been corrected.

The solution lies not in making the "tell them" message more reliable, as network failures are inevitable. Instead, the better approach is to add a second habit: regularly checking what is truly accurate, rather than solely relying on the information provided.

Going back to the hostel analogy, instead of merely depending on students to report checkouts, imagine the warden conducting a brief daily round, physically checking which rooms are truly empty and correcting the register if necessary. Even if a student forgets to report their checkout, the warden's routine will identify the issue within a day.

In software, this is typically accomplished through a small background job that runs every few minutes: it examines all resources the system currently believes are in use and verifies if this remains true at that moment. If not, it corrects the record. This process is known as reconciliation – it involves double-checking what you believe by comparing it to reality on a regular schedule.

The key principle in creating this self-checking loop is to be cautious when in doubt. If the checking system cannot determine a clear answer—due to the other service being down or a timeout—you must leave things as they are and attempt the correction again in the next round. The correct loop should be: if you are certain the resource is still in use, leave it alone; if it is not in use, free it up; if you are unclear or unable to determine the status, do nothing and check again next time.

This approach prevents a situation where you accidentally free up a resource that is still in use, which would be far more detrimental than merely having a false "occupied" mark for a short period.

In summary, whenever your system includes a step that requires confirmation of completion, consider the implications if that confirmation never arrives. If the consequences could be a lingering error, it is essential to implement a regular "go check yourself" mechanism. This simple practice can effectively resolve the issue, making your system more robust and reliable.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The MVP Scope Line: An Engineering Framework for What Actually Ships First

Most MVP scoping conversations happen at the wrong layer. A founder has 40 features in a spec and a budget for 12, so the conversation turns into a prioritization exercise: rank features, cut from the…

  • MVP scope discussion often focuses on wrong level
  • Features categorized into core, deferrable, and architecturally indispensable
  • Core decisions made prior to first feature implementation

More from Friday 9 October →