One pipeline, one document, and 46 minutes of stalled deploys
DEV Community

One pipeline, one document, and 46 minutes of stalled deploys

Friday 13 November 2026, just before six in the evening, UTC. Pipelines on Harness prod3 started hanging. Not all of them, and not all at once.

Some slowed to a crawl. Some would not start at all. Some sat there long enough that the platform gave up on them, aborting any execution that had been stuck for more than five minutes.

Two customers reported the slowdown. The rest of the platform looked fine. There had been no deploy to blame. No config change, no bad release, no spike in traffic that anyone could point at. The pipelines were just... stopping.

That is the kind of failure that makes an on-call engineer reach for a second coffee, because the usual suspects are all innocent and the clock is running. This is the story of what they found, and it is a story about a single document.

The clue that narrowed it down

The first useful fact was the boundary. The trouble was confined to prod3, one of Harness's environments, and to the part of the platform that runs pipelines: Continuous Delivery, Next Generation, or CDNG for short. Everything else was healthy.

The second useful fact was what the slowdown had in common. The pipelines that hung were not the biggest ones, or the newest ones, or the ones from a particular customer. They were the ones whose progress had to be recorded through the same database node, the one that backs pipeline orchestration in prod3.

That node was saturated. Its CPU was maxed out and its write capacity was exhausted, so every pipeline that needed it had to wait in line behind work that was never going to finish quickly.

So the question changed. It was no longer "why are pipelines hanging?" It was "what is hammering this one database node?" The answer was a single customer pipeline.

One document for the whole pipeline

To understand why one pipeline could do that, you need to know how Harness tracks a pipeline while it runs. A pipeline is a set of stages. A stage might build code, run tests, or deploy to a cluster. Stages can run one after another, or side by side.

While a pipeline runs, the platform keeps a record of where each stage has got to: started, running, finished, failed. That record is what the user interface shows you, and it is what the platform itself consults to decide what to do next.

In Harness's design, that record lives in a single internal data structure for the whole execution. One document per pipeline run. Every stage writes its progress into that same document.

A document, in plain terms, is a single stored record in a database, like one row in a spreadsheet that holds a whole bundle of related fields. When a stage finishes a step, the platform opens that document, updates the field for that stage, and saves it back.

Under normal conditions this is cheap. A pipeline has a handful of stages, they mostly take turns, and the document is small. On 13 November, one customer's pipeline broke both of those assumptions at once.

Too many writers, one page

The triggering pipeline ran with an unusually large number of stages at the same time. The postmortem does not give the exact number, and this article will not guess at one. What matters is the shape: dozens of stages, all live at once, all trying to write their progress into the same single document.

When two writers try to update the same document at the same moment, their writes conflict. The database can only accept one at a time, so the loser has to try again. That is normal, and a single retry costs almost nothing. But here the retries piled up.

Each conflicting write had to be retried, and as the queue of pending writes grew, operations started timing out on an internal lock-wait window. A lock-wait window is a time limit: how long a write is allowed to wait its turn before the system gives up waiting politely and resubmits the write to the database directly.

Those resubmissions added more load to a node that was already saturated. And then the third loop kicked in. As the pipeline grew in size, its state document grew larger too, because there were more stages to record. A larger document takes longer to read, update, and save.

So each individual write got slower, which made the queue longer, which made more writes time out, which made more writes get resubmitted. Three loops, all feeding each other: conflicts creating retries, retries creating timeouts, and a growing document making every write slower than the last.

One pipeline, writing to one document, had turned into a denial of service against its own database node. And because every pipeline in prod3 shared that node, they all paid for it.

The incident lasted 46 minutes, from 17:56 to 18:42 UTC. It ended the way these things sometimes do: not with a heroic fix, but because the triggering pipeline finished its updates. Its stages completed, the writes stopped, CPU usage fell back to normal, write latency recovered, and the backlog of delayed pipeline events cleared.

By the time the responders had isolated the triggering pipeline as the cause, recovery was already under way. No scale-up, no restart, no failover was needed.

Harness's interim safeguard was to increase the lock-wait window, which lowers the chance of writers piling up, though the postmortem is honest that it does not eliminate it. The permanent fix, in progress at the time the postmortem was published on 18 November, is architectural: split a pipeline execution's state across multiple documents, sharded by stage, so no single execution can concentrate that much write contention on one document or one database primary, whatever its size.

The pattern to steal

This failure has a name in database circles: a hot document, or a hot key. It is one record that every writer in the system needs at the same time. It shows up in places you would not expect.

  • A single row that tracks a global counter.
  • One document that holds an entire shopping cart.
  • A status record for a whole job that every worker updates.

The shape is always the same: many writers, one record, and a queue that grows faster than it drains.

If you keep state in one place per job, here is the shape of the fix, in two languages. First, shard the state. Instead of one document per execution that every stage writes to, give each stage its own document, and read the full picture by gathering them.

In Go, that looks like this:

// One state record per stage, not one per execution.
// Stages write to different keys, so they never queue on each other.
func stageStateKey(executionID, stageID string) string {
  return "exec:" + executionID + ":stage:" + stageID
}
func recordStageProgress(store Store, executionID, stageID, status string) error {
  return store.Put(stageStateKey(executionID, stageID), StageState{
    StageID: stageID,
    Status: status,
    UpdatedAt: time.Now(),
  })
}
// Reading the whole execution means gathering the stage records.
func executionSummary(store Store, executionID string) ([]StageState, error) {
  return store.ListByPrefix("exec:" + executionID + ":stage:")
}

The trade is deliberate. Writes get cheaper and never block each other. Reads get slightly more expensive, because you gather several small records instead of opening one big one. That is almost always the right trade, because a hot write path hurts everyone at once, while a slightly slower read hurts one reader.

Second, bound the retries. A retry is a second attempt at work the system could not complete, and retries without a limit are how a small conflict becomes a flood. In Python, a retry with jittered backoff and a hard cap looks like this:

import random
import time
def update_with_retry(update_fn, max_attempts=3, base_delay=0.1):
    """Retry a conflicting write a few times, with a random delay so competing writers do not all retry in the same instant."""
    for attempt in range(max_attempts):
        try:
            return update_fn()
        except WriteConflict:
            if attempt == max_attempts - 1:
                raise
            delay = base_delay * (2 ** attempt) + random.uniform(0, base_delay)
            time.sleep(delay)

Two details matter here. The delay doubles each time, so a writer that keeps losing backs off further instead of hammering the same document. And the random part, the jitter, stops every loser from retrying at the same instant and colliding again. Without jitter, retries synchronise, and a synchronised retry storm is just the original conflict wearing a different hat.

Third, watch the write rate per entity, not just the total. Harness's own next steps include monitoring that can spot one execution driving a disproportionate share of database writes. A dashboard that shows total write load would have shown a saturated node and nothing else. A per-execution breakdown would have pointed straight at the one pipeline. If you run a system where many tenants share one store, alert on the single loudest writer, not just on the total volume. The loudest writer is usually the story.

What to take away

The pipeline that caused this outage was not broken. It was doing exactly what pipelines are for: running many stages at once. The platform's design assumed that would stay cheap, because one document per execution had always been cheap. It was cheap right up until a pipeline arrived that was big enough to make it expensive, and then it was expensive for everyone sharing that node.

That is the part worth sitting with. The failure was not a bug in the usual sense. Nobody wrote the wrong code. The design simply had a scaling limit hidden inside it, and the limit was measured in concurrent writers to a single record. Limits like that do not announce themselves. They wait for the first customer big enough to find them.

So the question is not whether your system has a hot document in it. Most systems do, somewhere, in a counter, a status record, or a per-job summary that every worker updates. The question is whether you know which record it is, and what happens on the day two dozen writers arrive at it at once.

When did you last check what your busiest single record costs when everyone writes to it at the same time?

Sources: Harness, "Pipeline slowness on prod3", status page postmortem published 18 November 2026. Incident 13 November 2026, 17:56 to 18:42 UTC, 46 minutes. The Go and Python snippets show the shape of the fix, not Harness source code.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.