A supervised process crashed 10025 times while eight sibling services running on the same host did not register a single crash over 3 days. When an autonomous streaming worker gets locked into PM2's waiting restart status, teams instinctively blame event loop blocking, memory bloat, or bad code deploy. That instinct is wrong when your workers rely on an upstream Oracle connection pool that silently runs dry during documentation audits and administrative repo migrations.
I run production AI automation and data extraction agents on Oracle Cloud Infrastructure without venture funding. When monitoring pm2 jlist, eight out of nine supervised processes showed clean uptimes of 3 days. Only algom-stream collapsed into an unbroken loop of 10025 restarts, trapped while trying to re-establish an unbuffered socket connection against an overloaded endpoint.
The Asymmetry: 10025 Restarts Against Eight Stable Siblings
When an infrastructure node fails, you expect widespread collateral damage across the application tier. That is not what happened here. The PM2 process table recorded an absolute divergence across nine managed workers:
pm2-logrotate held 84 MB and 0 restarts across 3 days. dragontrade-dashboard consumed 77 MB with 0 restarts across 3 days. dragontrade-main held 183 MB with 0 restarts. algom-poll consumed 79 MB with 0 restarts. whitespace held 109 MB, n8n held 397 MB, and serpapi-jobs held 106 MB—every single one running continuously for 3 days with 0 restarts. Even cto-aipa, handling agent orchestration, logged only 8 restarts while running for 1 day at 216 MB.
Yet algom-stream sat in waiting restart with 10025 restarts and 0 days of uptime.
┌──────────────────────┬──────────┬──────────┬────────┬──────────┐
│ Process Name │ Status │ Restarts │ Uptime │ Memory │
├──────────────────────┼──────────┼──────────┼────────┼──────────┤
│ pm2-logrotate │ online │ 0 │ 3d │ 84 MB │
│ dragontrade-dashboard│ online │ 0 │ 3d │ 77 MB │
│ cto-aipa │ online │ 8 │ 1d │ 216 MB │
│ algom-stream │ waiting │ 10025 │ 0d │ 0 MB │
│ dragontrade-main │ online │ 0 │ 3d │ 183 MB │
│ algom-poll │ online │ 0 │ 3d │ 79 MB │
│ whitespace │ online │ 0 │ 3d │ 109 MB │
│ n8n │ online │ 0 │ 3d │ 397 MB │
│ serpapi-jobs │ online │ 0 │ 3d │ 106 MB │
└──────────────────────┴──────────┴──────────┴────────┴──────────┘
The difference between algom-poll (0 restarts) and algom-stream (10025 restarts) reveals the operational bottleneck. Polling scripts request batches over standard HTTP or discrete queries, fail gracefully on connection timeouts, and exit cleanly until the next cron interval. A persistent stream, built on persistent database connectivity via oracledb, demands immediate handshakes. If the connection pool denies an allocation, the streaming thread throws an uncaught error and crashes immediately on bootstrap. PM2 restarts it; it crashes again; within hours, the restart count surpasses five figures.
Tracing Upstream Dependency to the EspaLuz Resilience Migration
Why did the pool dry up exclusively for the streaming ingestion pipe? The answer was committed directly to the cto-aipa repository across 12 commits over 48 hours.
During this operational window, an extensive migration and audit cycle was underway for our EspaLuz pipeline. Commit 8ec1fcd6 executed a rewrite of the system resilience documentation across three parts: product catalog by repository, an Oracle rescue procedure, and a 4everland rescue runbook. Immediately alongside this work, commit a4012765 conducted a claim-by-claim re-evaluation of market-fit metrics, and commit a87d931f locked in doc rewrite verifications without restarting baseline platform services.
Concurrently, heavy reconciliation jobs were executed against database records. Commit 5695586c exposed a major data validation gap: EspaLuz real people = 51, not 71 (20 web twins of synthetic families); why none pay, from Twilio + truth snapshot. The reconciliation scripts verifying these 51 actual users (stripping out the 20 web twins) generated continuous analytical reads. Meanwhile, our scheduled background jobs were writing heavily: the log tail from espaluz-truth.log recorded batches of written: 480 rows to truth_people writing repeatedly every few minutes.
While espaluz-truth successfully committed its 480 rows per sweep and batch workers completed their passes, they consumed available connections. Because algom-stream lacked an exponential backoff circuit breaker for its initial oracledb pool allocation, any transient state of connection exhaustion immediately killed the process. Instead of pausing 30 seconds before re-attempting, PM2 instantly rebooted the node binary into the same saturated bottleneck, escalating the counter to 10025 restarts.
Log Verification Across Co-Located Workflows
To verify whether the crash cascade impacted broader automation pipelines, we surveyed the system logs across the environment:
The rest of the infrastructure was healthy. The upstream bottleneck was isolated strictly to real-time socket allocation against Oracle, demonstrating that connection pool starvations do not announce themselves through general server crashes. They hit the most brittle, persistent client first.
Eliminating Stream Crash Cascades Under Shared Pools
When running production AI agents and heavy workers on lean cloud instances, persistent stream consumers must be isolated from batch workloads.
First, enforce a strict minimum reconnect delay in PM2 process ecosystems. When a process restarts 10025 times, it consumes CPU cycles, floods journal logs, and increases lock contention on database sockets. Implementing exp_backoff_restart_delay ensures that if a streaming worker fails to acquire a connection handle, PM2 steps back systematically rather than hammering the port.
Second, separate analytical audit connections from operational streaming pools. During the EspaLuz review, validating whether the user base was 51 real accounts or 71 accounts required heavy deduplication. Running those queries against the primary connection limits squeezed out high-frequency ingestion workers.
Third, maintain strict queue hygiene. When multiple agents or developers commit changes—as seen across our 12 commits in cto-aipa and 6 commits in aideazz over 48 hours—operational boundaries must be explicit. In NOW.md, our team explicitly locked an ad-hoc task: a one-off scheduled job running bash -c sleep … ; node news_sweep_20261126.cjs that fired on 27 Nov, ensuring background scripts touch zero cron jobs or repos without explicit coordination. The same discipline must apply to database connection pool limits.
Frequently Asked Questions
Q: Why did algom-stream enter waiting restart while algom-poll experienced zero crashes?
A: algom-poll executes scheduled batch requests that exit cleanly between intervals, avoiding sustained pool occupancy. algom-stream relies on an unbroken persistent connection; when upstream pool limits were saturated by verification jobs writing batches of 480 rows, algom-stream threw unhandled connection errors on launch and entered an immediate reboot loop.
Q: Did the 10025 restarts degrade system responsiveness for other monitored agents?
A: Host performance remained steady: sibling processes like dragontrade-main (183 MB) and n8n (397 MB) logged zero restarts over 3 days, and self-tests completed in 4063ms. However, PM2 was forced to supervise an unnecessary thrashing cycle that polluted process event monitoring.
Q: How did database data validation jobs impact real-time automation pools?
A: Audit scripts validating 51 genuine users against 20 web twins, combined with continuous database operations logging 480 rows per write pass, temporarily exhausted connection limits. Without connection reservation rules, the real-time ingestion worker failed its initial connection check repeatedly.
Q: What is the fastest operational fix when a PM2 worker hits thousands of restarts?
A: Configure an exponential backoff restart delay in the PM2 configuration file and allocate a dedicated, isolated connection pool ceiling for persistent streaming services to shield them from analytical batch workloads.
— Elena Revicheva · AIdeazz AI Lab · Portfolio · Professional Outlook (PDF)
EspaLuz: live your new country in Spanish. Confidence, belonging and independence for international families in Latin America (web, WhatsApp, Telegram; 14 days free): aideazz.xyz/espaluz