Importer can permanently wedge on `active_import_results` 20s timeout during catch-up sync
Summary
During catch-up sync, fuel-core can enter a permanent wedge where block import stalls on a single height. The node repeatedly logs the importer's hardcoded 20s active_import_results timeout and never advances, even though the process is still alive and consuming CPU.
A process restart clears the wedge and import resumes — which strongly suggests stuck in-process notification / subscriber state, not a permanently unprocessable block.
This should not require an external process restart to recover.
Relevant code (crates/services/importer/src/importer.rs):
// Await until all receivers of the notification process the result.
const TIMEOUT: u64 = 20;
let await_result = tokio::time::timeout(
Duration::from_secs(TIMEOUT),
self.active_import_results.clone().acquire_owned(),
)
.await;
let Ok(permit) = await_result else {
tracing::error!(
"The previous block processing \
was not finished for {TIMEOUT} seconds."
);
return Err(Error::PreviousBlockProcessingNotFinished)
};Same pattern exists in both commit_result and execute_and_commit.
Observed behavior
On mainnet sentry nodes bootstrapped from a near-tip RocksDB snapshot (PVC/volume clone) and catching up tens of thousands of blocks:
Import advances for a while (a few blocks/sec).
Height freezes at some
H. The next heightH+1never commits.Logs repeat roughly every 20s:
The previous block processing was not finished for 20 seconds.No further
Committed blocklines.Process remains up; CPU stays non-idle (~1+ cores observed) — not an obvious idle I/O wait.
/v1/healthcan still succeed while/v1/readystays not ready (syncedmay report true while services have not finished starting / Ready stays false until tip).Independent nodes wedge at different heights in the same environment, so it does not look like one unique “poison block.”
Deleting/restarting the process unsticks import; height advances again until the next wedge.
We also observed this after volume lazy-initialization had completed, so the hang is not explained solely by cold/lazy disk hydration (though slow I/O may make it more likely by delaying notification consumers).
How to reproduce (best effort)
We do not yet have a minimal local repro. Closest production-shaped path:
Run a mainnet (or large) sentry from a recent DB snapshot so it must catch up a large gap (order of 10⁴–10⁵ blocks).
Allow sync under normal GraphQL / service subscribers (anything that holds
SharedImportResult/ importer notification receivers).Watch logs for repeated:
The previous block processing was not finished for 20 seconds.with zero new committed heights for several minutes.
Confirm frozen committed height across that window.
Restart the process without changing the DB; observe that import resumes past the previously frozen height.
If useful for maintainers: the back-pressure semaphore is sized from max_block_notify_buffer and is intended to wait until all receivers finish processing the previous import result before committing the next block. The failure mode is that this wait can fail forever for a given height instead of recovering.
Expected behavior
- A slow or stuck notification consumer should not permanently halt chain progress for the whole node.
- On timeout, the importer should either:
- drop / disconnect the slow subscriber and continue, or
- fail loudly and shut down the node so orchestration can restart it cleanly, or
- surface a recoverable error path that unblocks subsequent commits without an external kill.
- Prefer: never wedge indefinitely on one height while the process appears healthy.
Suggested directions (non-prescriptive)
- Identify which subscriber holds the permit when the 20s timeout fires (log subscriber identity / lag / oldest
SharedImportResultage) so operators can see the root cause instead of only the generic timeout. - Fail closed or fail open on timeout: today the commit returns
PreviousBlockProcessingNotFinishedand the sync loop retries the same height forever. Consider treating a timed-out notification as a dropped receiver (release permit) or stopping the service so restart is automatic. - Bound subscriber processing more aggressively than a single global 20s gate (per-subscriber deadlines; isolate GraphQL / indexer / other consumers from the commit critical path).
- Self-heal: if N consecutive 20s timeouts occur with no commit progress, reset notification state / resubscribe / restart the importer task internally.
- Make the timeout configurable and emit a metric (
importer_notify_timeout_total,importer_commit_stall_seconds) so this is alertable without log scraping.
Impact
- Sentries (and likely other roles) catching up after restore/clone can stall indefinitely.
- Orchestration that only checks liveness will not recycle the pod; Ready stays false until tip, so catch-up never completes without manual or external restart loops.
- Operational workaround today: detect ≥2 timeout log lines with 0 commits in a short window, then restart the process. That should not be required for correctness.
Environment notes
- Network: Fuel mainnet
- Role: GraphQL sentry (catch-up after DB snapshot restore)
- Symptom persists across different wedge heights and across process restarts (recurs during long catch-up)
- Process restart is sufficient to clear a given wedge; DB rewrite / re-clone is not required once height has already advanced near tip
Related
Happy to add redacted log excerpts, metrics, or help reproduce under guidance from maintainers.
Source: FuelLabs/fuel-core