This is a really good distinction: synchronization is not scheduling. π
I think thatβs where Promise.all(items.map(...)) becomes deceptive. The code looks nicely controlled because everything is wrapped in one await, but the actual work may already be flooding the downstream service.
I also really like the comparison with fixed-size chunks. A worker pool keeping the available slots busy is much nicer than making 9 fast tasks wait for one slow one. πΈ
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Thanks so much, nyaomaru! That single await really does create a false sense of safety. It looks tidy on the page even while all those requests are already firing at once. Glad the chunking comparison resonated too, since eliminating that tail-latency bottleneck is usually where the biggest real-world speedup comes from.
One thing worth adding to the numbers: swapping in Promise.allSettled fixes nothing here. It changes which rejections you see, not how many sockets you open, and one 429 still poisons the other 1,199 writes. The unbounded part is map() itself, so bounding the pool (p-limit, or an index-based worker loop over a fixed array of runners) is the actual fix; allSettled sits on top of that if you want per-invoice results instead of fail-fast.
Second: fetch won't queue for you either. undici's default Agent has no per-origin connection cap, so an app-level limit of ~8 is the only thing between the billing job and the payment gateway β same reason keep-alive alone doesn't save you. And even a bounded pool leaves partial commits when the gateway rejects mid-run, so the durable part is an idempotency key per invoice so a re-run doesn't double-charge. Did you reconcile the 1,199 orphaned writes by hand, or add a resume cursor keyed on the last committed id?
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Great points across the board, especially calling out undiciβs default Agent behavior, since a lot of folks assume keep-alive automatically queues excess requests per origin. For that initial incident, I reconciled the completed writes against the gateway's settlement logs and immediately paired the bounded pool with deterministic per-invoice idempotency keys and a persisted sync status so retries safely skip committed records. Appreciate you adding that production depth to the thread.
Small trap in mapWithConcurrency. If limit comes from config and ends up 0 or NaN (Number(process.env.SYNC_CONCURRENCY) when the var isn't set), Array.from makes zero workers, workerFn never runs, and it resolves with 5 empty slots like the job succeeded. I'd throw unless limit is an integer >= 1.
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Great catch. That is a nasty silent-failure trap, especially when Number(process.env.SYNC_CONCURRENCY) evaluates to NaN on an unset env var. Since Math.min(NaN, items.length) resolves to NaN, Array.from quietly creates zero workers and returns sparse empty slots as if the whole batch succeeded. Adding an explicit Number.isInteger(limit) && limit >= 1 guard at the top is definitely worth the extra line in production code.
I measure AI coding claims in public. LGTM β Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
The 429 storm gets all the attention, but the orphaned side effects are the part that scared me. Promise.all rejects on the first failure while the other 999 calls keep mutating state in the background with nothing awaiting them. I've hit the same shape with webhook retries, where the first attempt already landed and the retry has no idea. In your worker pool, when the AbortController fires mid-batch, what happens to the result slots for work that never ran? Do they stay empty, and can the caller tell "never ran" apart from "failed"?
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Orphaned writes on webhook retries are brutal to untangle after the fact. In the fail-fast mapWithConcurrency snippet, rethrowing inside the worker causes Promise.all(workers) to reject directly, so the results array is never returned and any unstarted slots simply remain uninitialized holes. When I need full per-item visibility after an early abort, I pre-fill results with { status: "skipped" } before starting the workers so the caller can cleanly distinguish tasks that failed from ones that never ran. Thanks for bringing up that edge case.
I measure AI coding claims in public. LGTM β Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
The pre-fill is the clean version β I was expecting holes to be the price of fail-fast, and skipped slots just remove the question entirely. Going to try that shape, see what the caller actually gets back after an abort. Does anything downstream ever mistake a skipped slot for a real result, or is the status field enough to keep them apart?
Web engineer building fast websites & apps for founders. I test AI coding tools in real workflows and share honest breakdowns: architecture, costs, what's hype. Guides at nilesharma.space
Great breakdown. The orphaned-writes point is the one that bites hardest, because the 429s show up in logs but the half-finished writes don't. Have you compared p-limit or p-map against a hand-rolled batching queue? I'm curious how you pick the concurrency number, whether from the upstream rate limit or from load testing.
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
In terms of raw throughput, p-limit and p-map perform virtually identically to a hand-rolled worker loop since they all just coordinate promise queues on the event loop. I usually reach for p-map in production apps because it handles AbortSignal and stopOnError out of the box, and keep the hand-rolled loop for zero-dependency scripts. To pick the concurrency limit, I start from the tightest hard constraint (such as the DB connection pool size or documented upstream limits with a 20β30% safety buffer) and tune upward in staging load tests until p95 latency starts climbing. Thanks for the thoughtful question.
Web engineer building fast websites & apps for founders. I test AI coding tools in real workflows and share honest breakdowns: architecture, costs, what's hype. Guides at nilesharma.space
Starting from the tightest hard limit with a buffer, then letting p95 in staging tell you when to stop, is a really practical rule. Good point on p-map's AbortSignal and stopOnError too; that alone saves re-implementing cancellation in a hand-rolled loop. Thanks for the detailed answer.
The 02:14 UTC 1,200-invoice failure is such a textbook trapβPromise.all looks harmless on 5 local mocks, then fires 5,000 sockets on the exact same tick in prod because map() doesn't throttle anything. Pairing bounded concurrency with idempotent partial state saves so much cleanup.
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
That local-to-prod jump is why that pattern catches so many teams off guard. Everything looks calm with five mocks until a real batch opens a flood of sockets on a single tick. Pairing a concurrency cap with idempotent state tracking makes recovery after a partial run vastly cleaner.
A concurrency limit is one of those fixes that looks boring and prevents a whole class of outages. A small p-limit around the batch usually costs a few lines and saves a rate-limit storm.
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Spot on. Those unglamorous 5-line guardrails are usually the difference between a quiet on-call rotation and a 2 AM rate-limit cascade, and p-limit is a great lightweight default for that exact reason. Thanks for reading.
One extra edge case if this job runs across multiple replicas: a worker pool only limits concurrency inside one process. Two overlapping billing runs or several workers can each stay under their local cap while the payment gateway still sees a burst above the account-level rate limit.
For shared API keys, I'd pair local concurrency limits with a distributed rate budget and make sure scheduled runs can't overlap when that's unsafe.
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Great addition, Vlad. An in-process pool only protects a single instance, so horizontal scaling or overlapping cron triggers can quietly multiply traffic against a shared API key. Putting a distributed lock around scheduled runs and coordinating global throughput via a shared rate limiter (like a Redis token bucket) closes that multi-replica gap cleanly.
Promise.all over a 10k-item array is basically a DDoS you schedule against your own database.
The bounded worker pool is the right fix. It's the same idea as backpressure in distributed systems, just at the function level. If the downstream API is rate-limited, pairing the pool with a simple token bucket keeps you from tripping 429s in bursts too.
Rate limiting and backpressure get a full deep dive in Grokking the System Design Interview at DesignGurus, and this is honestly one of the cleanest small-scale examples of why it matters that I've seen.
I research AI tools, APIs & agents β comparing specs, pricing and real user reports β then publish honest rankings so you don't waste money. Research-first, never sponsored fluff.
The worker pool is the part I'd actually copy, but one thing β aborting the controller stops the queue, it doesn't cancel the in-flight calls unless workerFn listens to the signal, so for that billing job you'd still have a handful of orphaned writes, just bounded instead of 1,199. Do you pass the signal into the actual gateway call in practice, or is stopping the queue good enough because the pool is small?
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Great catch. In practice, I always pass signal directly into fetch or the HTTP client to release sockets immediately, while keeping in mind that a client-side abort won't roll back a mutating gateway request the server has already received. Bounding the pool shrinks that blast radius to just a handful of records, and pairing it with per-invoice idempotency keys and persisted sync statuses handles those few in-flight writes cleanly on retry. Thanks for highlighting that nuance.
The worker pool is the right fix for the flood, but for a billing job I would pair it with an idempotency key per invoice. The pool stops the 429 storm, yet a retry after an abort can still double-charge, and only an idempotent sync makes the retry safe.
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Completely agree. Bounding concurrency protects the upstream API from getting flooded, while deterministic idempotency keys per invoice are what actually make retries safe after a mid-batch abort without risking double charges.
Two founders who write the code. We build headless commerce, CMS platforms and web apps on Medusa, Directus and Next.js. You own the repo, the data and the infra.
The detail that bothers me most in the opening isn't the 429, it's the 1,199 writes that had already happened when the last promise rejected. Failing fast doesn't undo anything, it just stops telling you what succeeded.
So the fix is really two parts: a bounded pool so you don't flood the API, and making each item safe to re-run, so the retry after a crash doesn't double-bill the customers that already went through.
Same thing shows up a lot in commerce sync jobs (pushing prices to a search index, syncing orders to an ERP). The rate limit is the loud failure, the half-finished batch is the quiet one.
Do you track per-item progress so a rerun can skip what already finished, or lean on idempotent writes downstream?
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
That framing nails it. The 429 is noisy, while the half-finished batch is what quietly leaves state inconsistent. In practice, I pair both: per-item checkpoints (like a persisted sync status or timestamp) let reruns skip completed work and save API quota, while downstream idempotency keys cover the narrow window where an external write landed right before the local checkpoint could be saved. Appreciate you sharing the commerce sync parallel.
This is a really clear explanation of the difference between synchronization and scheduling. The 1,200 invoice example makes the risk concrete, especially the orphaned writes that happen when Promise.all fails fast. I have seen the same pattern with smaller batches too, where everything looks fine in local testing and only breaks under real load. A bounded worker pool with a sensible limit is a fix I will be using more often now. Thanks for writing this up.
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Appreciate the kind words! That gap between local tests and real production load is exactly what makes Promise.all so deceptive. Even modest batches behave completely differently once real network latency and downstream connection limits come into play. Glad the bounded worker pool pattern will be useful in your projects.
Full-stack developer building ImportFlow. Interested in Postgres, Supabase, data migrations, developer tools, and making production systems fail safely.
One thing to watch: a limit of 10 concurrent requests doesnβt necessarily keep you under an APIβs per-second limit.
If each request takes 100 ms, those 10 workers could send roughly 100 requests in a second. For an API with a time-based quota, you might need a rate limiter alongside the worker pool, plus a retry policy for 429s.
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
That is a crucial distinction. Capping in-flight concurrency only bounds simultaneous connections, not throughput over time. When responses come back in 100ms, 10 workers will happily push ~100 RPS and still trip a time-windowed quota. Pairing the worker pool with a token-bucket rate limiter and jittered backoff on 429 responses is the complete setup for strict RPS-limited APIs. Thanks for calling that out.
One edge case Iβd guard before starting the workers is a limit of zero, a negative value or a non-integer. Silently returning an unfilled results array would be a confusing success. Iβd also separate concurrency from requests per second; even a small pool can exceed a fast APIβs quota. This rate-limiter exercise is a good extension of that second problem.
Full-stack developer in Al-Khobar, Saudi Arabia. 6+ years building production platforms for events, ticketing and healthcare. Vue, Node.js, Flutter. Writing about real bugs and Arabic/RTL web.
ran into exactly this on an event check in system lol. a sync job fired hundreds of mysql writes at once and the pool (connectionLimit 10) just turned into a wall of timeouts. what fixed it for us was capping concurrency to the pool size and using allSettled so one bad record doesnt hide all the good writes. now i match worker limit to db pool size by default everywhere
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
That MySQL connectionLimit: 10 wall of timeouts is a classicβfiring hundreds of writes at once starves the pool queue almost instantly. Matching the worker cap directly to the database pool size (or leaving a small headroom buffer for live reads) alongside allSettled-style handling is a rock-solid default. Thanks for sharing that real-world fix, Ahmed.
I write about Next.js + TypeScript + AI engineering, with a focus on making sites discoverable to LLMs and AI search. Long-form notes at mudassirkhan.me
the fail fast orphaned side effects bit is the one that burns people most. we had a nightly sync where one rejection left 900 writes still running with nothing awaiting them, and the retry then double wrote half of them.
the worker pool with the abort signal fixes the scheduling, but the abort only stops queued work, not requests already in flight. do you make the writes idempotent as well, or lean on the abort alone?
We're a place where coders share, stay up-to-date and grow their careers.
This is a really good distinction: synchronization is not scheduling. π
I think thatβs where
Promise.all(items.map(...))becomes deceptive. The code looks nicely controlled because everything is wrapped in oneawait, but the actual work may already be flooding the downstream service.I also really like the comparison with fixed-size chunks. A worker pool keeping the available slots busy is much nicer than making 9 fast tasks wait for one slow one. πΈ
Great article, John! π
Thanks so much, nyaomaru! That single
awaitreally does create a false sense of safety. It looks tidy on the page even while all those requests are already firing at once. Glad the chunking comparison resonated too, since eliminating that tail-latency bottleneck is usually where the biggest real-world speedup comes from.One thing worth adding to the numbers: swapping in Promise.allSettled fixes nothing here. It changes which rejections you see, not how many sockets you open, and one 429 still poisons the other 1,199 writes. The unbounded part is map() itself, so bounding the pool (p-limit, or an index-based worker loop over a fixed array of runners) is the actual fix; allSettled sits on top of that if you want per-invoice results instead of fail-fast.
Second: fetch won't queue for you either. undici's default Agent has no per-origin connection cap, so an app-level limit of ~8 is the only thing between the billing job and the payment gateway β same reason keep-alive alone doesn't save you. And even a bounded pool leaves partial commits when the gateway rejects mid-run, so the durable part is an idempotency key per invoice so a re-run doesn't double-charge. Did you reconcile the 1,199 orphaned writes by hand, or add a resume cursor keyed on the last committed id?
Great points across the board, especially calling out
undiciβs defaultAgentbehavior, since a lot of folks assume keep-alive automatically queues excess requests per origin. For that initial incident, I reconciled the completed writes against the gateway's settlement logs and immediately paired the bounded pool with deterministic per-invoice idempotency keys and a persisted sync status so retries safely skip committed records. Appreciate you adding that production depth to the thread.Small trap in mapWithConcurrency. If limit comes from config and ends up 0 or NaN (
Number(process.env.SYNC_CONCURRENCY)when the var isn't set), Array.from makes zero workers, workerFn never runs, and it resolves with 5 empty slots like the job succeeded. I'd throw unless limit is an integer >= 1.Great catch. That is a nasty silent-failure trap, especially when
Number(process.env.SYNC_CONCURRENCY)evaluates toNaNon an unset env var. SinceMath.min(NaN, items.length)resolves toNaN,Array.fromquietly creates zero workers and returns sparse empty slots as if the whole batch succeeded. Adding an explicitNumber.isInteger(limit) && limit >= 1guard at the top is definitely worth the extra line in production code.The 429 storm gets all the attention, but the orphaned side effects are the part that scared me. Promise.all rejects on the first failure while the other 999 calls keep mutating state in the background with nothing awaiting them. I've hit the same shape with webhook retries, where the first attempt already landed and the retry has no idea. In your worker pool, when the AbortController fires mid-batch, what happens to the result slots for work that never ran? Do they stay empty, and can the caller tell "never ran" apart from "failed"?
Orphaned writes on webhook retries are brutal to untangle after the fact. In the fail-fast
mapWithConcurrencysnippet, rethrowing inside the worker causesPromise.all(workers)to reject directly, so theresultsarray is never returned and any unstarted slots simply remain uninitialized holes. When I need full per-item visibility after an early abort, I pre-fillresultswith{ status: "skipped" }before starting the workers so the caller can cleanly distinguish tasks that failed from ones that never ran. Thanks for bringing up that edge case.The pre-fill is the clean version β I was expecting holes to be the price of fail-fast, and skipped slots just remove the question entirely. Going to try that shape, see what the caller actually gets back after an abort. Does anything downstream ever mistake a skipped slot for a real result, or is the status field enough to keep them apart?
Great breakdown. The orphaned-writes point is the one that bites hardest, because the 429s show up in logs but the half-finished writes don't. Have you compared p-limit or p-map against a hand-rolled batching queue? I'm curious how you pick the concurrency number, whether from the upstream rate limit or from load testing.
In terms of raw throughput,
p-limitandp-mapperform virtually identically to a hand-rolled worker loop since they all just coordinate promise queues on the event loop. I usually reach forp-mapin production apps because it handlesAbortSignalandstopOnErrorout of the box, and keep the hand-rolled loop for zero-dependency scripts. To pick the concurrency limit, I start from the tightest hard constraint (such as the DB connection pool size or documented upstream limits with a 20β30% safety buffer) and tune upward in staging load tests until p95 latency starts climbing. Thanks for the thoughtful question.Starting from the tightest hard limit with a buffer, then letting p95 in staging tell you when to stop, is a really practical rule. Good point on p-map's AbortSignal and stopOnError too; that alone saves re-implementing cancellation in a hand-rolled loop. Thanks for the detailed answer.
The 02:14 UTC 1,200-invoice failure is such a textbook trapβPromise.all looks harmless on 5 local mocks, then fires 5,000 sockets on the exact same tick in prod because map() doesn't throttle anything. Pairing bounded concurrency with idempotent partial state saves so much cleanup.
That local-to-prod jump is why that pattern catches so many teams off guard. Everything looks calm with five mocks until a real batch opens a flood of sockets on a single tick. Pairing a concurrency cap with idempotent state tracking makes recovery after a partial run vastly cleaner.
A concurrency limit is one of those fixes that looks boring and prevents a whole class of outages. A small p-limit around the batch usually costs a few lines and saves a rate-limit storm.
Spot on. Those unglamorous 5-line guardrails are usually the difference between a quiet on-call rotation and a 2 AM rate-limit cascade, and
p-limitis a great lightweight default for that exact reason. Thanks for reading.One extra edge case if this job runs across multiple replicas: a worker pool only limits concurrency inside one process. Two overlapping billing runs or several workers can each stay under their local cap while the payment gateway still sees a burst above the account-level rate limit.
For shared API keys, I'd pair local concurrency limits with a distributed rate budget and make sure scheduled runs can't overlap when that's unsafe.
Great addition, Vlad. An in-process pool only protects a single instance, so horizontal scaling or overlapping cron triggers can quietly multiply traffic against a shared API key. Putting a distributed lock around scheduled runs and coordinating global throughput via a shared rate limiter (like a Redis token bucket) closes that multi-replica gap cleanly.
Promise.all over a 10k-item array is basically a DDoS you schedule against your own database.
The bounded worker pool is the right fix. It's the same idea as backpressure in distributed systems, just at the function level. If the downstream API is rate-limited, pairing the pool with a simple token bucket keeps you from tripping 429s in bursts too.
Rate limiting and backpressure get a full deep dive in Grokking the System Design Interview at DesignGurus, and this is honestly one of the cleanest small-scale examples of why it matters that I've seen.
The worker pool is the part I'd actually copy, but one thing β aborting the controller stops the queue, it doesn't cancel the in-flight calls unless workerFn listens to the signal, so for that billing job you'd still have a handful of orphaned writes, just bounded instead of 1,199. Do you pass the signal into the actual gateway call in practice, or is stopping the queue good enough because the pool is small?
Great catch. In practice, I always pass
signaldirectly intofetchor the HTTP client to release sockets immediately, while keeping in mind that a client-side abort won't roll back a mutating gateway request the server has already received. Bounding the pool shrinks that blast radius to just a handful of records, and pairing it with per-invoice idempotency keys and persisted sync statuses handles those few in-flight writes cleanly on retry. Thanks for highlighting that nuance.The worker pool is the right fix for the flood, but for a billing job I would pair it with an idempotency key per invoice. The pool stops the 429 storm, yet a retry after an abort can still double-charge, and only an idempotent sync makes the retry safe.
Completely agree. Bounding concurrency protects the upstream API from getting flooded, while deterministic idempotency keys per invoice are what actually make retries safe after a mid-batch abort without risking double charges.
I think I have done the Promise.all thing on a big list before and learned it the hard way too.
The detail that bothers me most in the opening isn't the 429, it's the 1,199 writes that had already happened when the last promise rejected. Failing fast doesn't undo anything, it just stops telling you what succeeded.
So the fix is really two parts: a bounded pool so you don't flood the API, and making each item safe to re-run, so the retry after a crash doesn't double-bill the customers that already went through.
Same thing shows up a lot in commerce sync jobs (pushing prices to a search index, syncing orders to an ERP). The rate limit is the loud failure, the half-finished batch is the quiet one.
Do you track per-item progress so a rerun can skip what already finished, or lean on idempotent writes downstream?
That framing nails it. The 429 is noisy, while the half-finished batch is what quietly leaves state inconsistent. In practice, I pair both: per-item checkpoints (like a persisted sync status or timestamp) let reruns skip completed work and save API quota, while downstream idempotency keys cover the narrow window where an external write landed right before the local checkpoint could be saved. Appreciate you sharing the commerce sync parallel.
This is a really clear explanation of the difference between synchronization and scheduling. The 1,200 invoice example makes the risk concrete, especially the orphaned writes that happen when Promise.all fails fast. I have seen the same pattern with smaller batches too, where everything looks fine in local testing and only breaks under real load. A bounded worker pool with a sensible limit is a fix I will be using more often now. Thanks for writing this up.
Appreciate the kind words! That gap between local tests and real production load is exactly what makes
Promise.allso deceptive. Even modest batches behave completely differently once real network latency and downstream connection limits come into play. Glad the bounded worker pool pattern will be useful in your projects.One thing to watch: a limit of 10 concurrent requests doesnβt necessarily keep you under an APIβs per-second limit.
If each request takes 100 ms, those 10 workers could send roughly 100 requests in a second. For an API with a time-based quota, you might need a rate limiter alongside the worker pool, plus a retry policy for 429s.
That is a crucial distinction. Capping in-flight concurrency only bounds simultaneous connections, not throughput over time. When responses come back in 100ms, 10 workers will happily push ~100 RPS and still trip a time-windowed quota. Pairing the worker pool with a token-bucket rate limiter and jittered backoff on
429responses is the complete setup for strict RPS-limited APIs. Thanks for calling that out.One edge case Iβd guard before starting the workers is a limit of zero, a negative value or a non-integer. Silently returning an unfilled results array would be a confusing success. Iβd also separate concurrency from requests per second; even a small pool can exceed a fast APIβs quota. This rate-limiter exercise is a good extension of that second problem.
ran into exactly this on an event check in system lol. a sync job fired hundreds of mysql writes at once and the pool (connectionLimit 10) just turned into a wall of timeouts. what fixed it for us was capping concurrency to the pool size and using allSettled so one bad record doesnt hide all the good writes. now i match worker limit to db pool size by default everywhere
That MySQL
connectionLimit: 10wall of timeouts is a classicβfiring hundreds of writes at once starves the pool queue almost instantly. Matching the worker cap directly to the database pool size (or leaving a small headroom buffer for live reads) alongsideallSettled-style handling is a rock-solid default. Thanks for sharing that real-world fix, Ahmed.the fail fast orphaned side effects bit is the one that burns people most. we had a nightly sync where one rejection left 900 writes still running with nothing awaiting them, and the retry then double wrote half of them.
the worker pool with the abort signal fixes the scheduling, but the abort only stops queued work, not requests already in flight. do you make the writes idempotent as well, or lean on the abort alone?