Repository navigation
Description
Problem Statement
A single hung filesystem operation permanently freezes all content indexing for a dotCMS instance.
ReindexThread drains the dist_reindex_journal on a single thread (dot-ReindexThreadSubmitter-0). While mapping a contentlet for Elasticsearch, that thread performs blocking file I/O (File.exists() on binary fields). If the underlying storage is network-backed (NFS, EFS, S3-FUSE) and a single stat(2) never returns, the thread blocks forever in native code — RUNNABLE but frozen, no exception, no timeout, no log output. The reindex queue silently stops draining.
Production incident (2026-07-09): a tenant's assets live on an S3-backed FUSE mount (geesefs). A geesefs bug (yandex-cloud/geesefs#197) left single FUSE LOOKUP requests unanswered forever. One hung File.exists() froze all indexing for the instance for hours — three separate times in one day — with no error and no alert.
The FS bug is being pursued upstream, but dotCMS should not be architected so that one unanswered stat halts indexing forever.
Observed wedge points (thread dumps, Java 25, dotcms/dotcms:latest)
All three funnel through the single-threaded reindex loop (ReindexThread.runReindexLoop → appendToBulkProcessor):
- Title building during ES mapping
java.io.File.exists(File.java:790)
com.dotmarketing.portlets.contentlet.model.Contentlet.getBinary(Contentlet.java:1221)
com.dotmarketing.portlets.contentlet.model.Contentlet.buildName(Contentlet.java:446)
com.dotmarketing.portlets.contentlet.model.Contentlet.getTitle(Contentlet.java:347)
com.dotcms.content.elasticsearch.business.ESMappingAPIImpl.toMap(ESMappingAPIImpl.java:507)
com.dotcms.content.elasticsearch.business.ContentletIndexAPIImpl.addBulkRequestToProcessor(...)
com.dotmarketing.common.reindex.ReindexThread.runReindexLoop(ReindexThread.java:229)
- JSON→contentlet transform while loading version inodes
java.io.File.exists(File.java:790)
com.dotcms.content.business.json.ContentletJsonAPIImpl.getBinary(ContentletJsonAPIImpl.java:412)
com.dotcms.content.business.json.ContentletJsonAPIImpl.getContentletMapFromImmutable(...)
com.dotmarketing.portlets.contentlet.transform.ContentletTransformer.transform(...)
com.dotcms.content.elasticsearch.business.ESContentFactoryImpl.findInDb(...)
com.dotcms.content.elasticsearch.business.ContentletIndexAPIImpl.loadVersionInodes(...)
- Metadata generation during ES mapping
java.io.File.exists(File.java:790)
com.dotmarketing.portlets.contentlet.model.Contentlet.getBinary(Contentlet.java:1221)
com.dotcms.storage.FileMetadataAPIImpl.generateBasicMetadata(FileMetadataAPIImpl.java:146)
com.dotcms.storage.FileMetadataAPIImpl.generateContentletMetadata(...)
com.dotcms.content.elasticsearch.business.ESMappingAPIImpl.writeMetadata(ESMappingAPIImpl.java:720)
com.dotcms.content.elasticsearch.business.ESMappingAPIImpl.toMap(ESMappingAPIImpl.java:617)
Steps to Reproduce
- Store contentlet binary assets on a network-backed filesystem (e.g., an S3 FUSE mount such as geesefs).
- Cause a single
stat/LOOKUP on one asset file to hang indefinitely (the geesefs bug above does this; any wedged NFS/FUSE mount reproduces it). - Trigger a reindex of content that includes the affected contentlet.
- Observe:
dot-ReindexThreadSubmitter-0blocks forever inFile.exists(); thedist_reindex_journalqueue stops draining; no error is logged; all content indexing for the instance halts until restart.
Acceptance Criteria
- A hung or slow storage operation while mapping one contentlet does not stop the reindex pipeline: that journal entry fails per existing
dist_reindex_journalretry/failure semantics (markAsFailed), and the loop continues with subsequent entries. - Per-contentlet mapping in the reindex path runs under a config-driven bounded timeout (e.g.
REINDEX_CONTENTLET_MAPPING_TIMEOUT_SECONDS, env-overridable viaDOT_prefix), with a generous default (60–120s);0disables the timeout and preserves current behavior exactly. - On timeout, a loud ERROR is logged including the contentlet identifier, inode(s), and mapping phase.
- A thread wedged in uninterruptible native I/O is abandoned (not interrupted-and-reused); the executor is bounded so wedged threads cannot pile up unbounded, and pool exhaustion logs a clear alarm (indicates storage itself is down).
- Existing journal failure semantics are reused, not reinvented.
- Unit tests: a mapping that blocks past the timeout fails that entry while the next entry still processes; timeout=0 preserves current behavior.
- Change is surgical to the reindex path —
Contentlet.getBinaryitself is not refactored.
dotCMS Version
Production, dotcms/dotcms:latest (Java 25). Code path present on main.
Severity
High - Major functionality broken
Links
- Upstream FS bug: FUSE LOOKUP request never answered (lost) under sustained lookup load — caller stuck in request_wait_answer forever, nothing logged yandex-cloud/geesefs#197
- NA (no Freshdesk ticket)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Jul 9, 2026
PRs linked to this issue
test(reindex): comprehensive coverage for the mapping timeout guard (#…
perf(storage): read metadata first, stat binaries only to (re)create (#…
perf(content): rebuild binary paths from json, don't list the assets …
test(storage): metadata is only written when missing, empty or unread…
fabrizzio-dotCMS commentedon Jul 14, 2026
QA Note — verified ✅ PASS
Verified the merged fix (PR #36499) end-to-end against a real running instance, with a side-by-side pre-fix vs fix comparison. All acceptance criteria confirmed.
How the disk hang was simulated (no code changes)
The bug needs a filesystem operation that never returns. I reproduced that with an OS-level primitive — a writerless FIFO (named pipe) — instead of a mock/lock in the code, so the exact merged artifact is what gets tested:
open()on a writerless FIFO blocks forever in uninterruptible native I/O — the sameRUNNABLE-but-frozen state as the incident's geesefs/NFS mount. Confirmed independently:timeout 3 cat <fifo>→ exit 124.Two honest deltas vs. the production incident, neither affecting the validity of the fix: the incident hung a
stat(File.exists) whereas the FIFO hangs theopen/read— but after the fix the only remaining FS touch in the guarded region is that metadataopen, and both funnel through the same single-threadedReindexThread. And I did not use a real network mount (a FIFO is a faithful, uninterruptible substitute). Crucially, an uninterruptible FIFO also validates the "abandoned, not interrupted-and-reused" requirement: the fix'sfuture.cancel(true)sends an interrupt that the FIFOopenignores — just like a wedged nativestat.Headline contrast (identical FIFO + content on both builds)
dotcms:latest, no guard)main)dot-ReindexThreadSubmitter-0RUNNABLEfrozen in nativeopen0foreverTIMED_WAITING(idle, healthy)dist_reindex_journalpriority 200→201, failed)Pre-fix wedge (the bug):
Fix guard (the timeout):
Results
0disables → legacy inline behavior restored (reindex thread wedges inline, no worker threads)MAX_THREADS=2→ exactly 2 carriers), pool-exhaustion alarm (... The underlying storage may be down.)priority+1, retried and succeeds once storage recoversbuildNamestat-removal changeGeneral reindex smoke (regression)
Beyond the targeted hang cases, ran a manual smoke of general reindex functionality on the fix build with default config (timeout 120s, guard active but not triggered):
POST /api/v1/esindex/reindex.inFullReindexationwenttrue → false(clean index switchover),lastIndexationProgressreached 24/24,errorCount = 0.dist_reindex_journaldrained to 0; no timeout / pool-exhaustion / reindex ERROR log lines.→ The guard adds no regression to normal reindex when storage is healthy.
One case not directly reproducible via FIFO (method limitation, not a fix defect): "slow-but-not-hung" — Tika re-opens the binary (MIME detect + parse) and a one-shot FIFO writer only satisfies the first open. The slow path shares the same code as the fast path (a plain
future.get(timeout)) and is covered by the retry case (readable binary maps within the window) plus the PR'sReindexMappingRunnerTest.Environment: local Docker, single-node PostgreSQL + Elasticsearch. Pre-fix
dotcms/dotcms:latest; fix built frommain(ec2.../current tip). Test content: File Asset / DotAsset contentlets with image binaries.fix(reindex): bound per-entry mapping so hung storage I/O can't wedge…