Skip to content

docs: add release notes and docs for jusText OOM fix (PR #1534) - #1697

Merged
lbliii merged 1 commit into
26.04-stagingfrom
lbliii/docs-justext-oom-fix
Apr 7, 2026
Merged

docs: add release notes and docs for jusText OOM fix (PR #1534)#1697
lbliii merged 1 commit into
26.04-stagingfrom
lbliii/docs-justext-oom-fix

Conversation

@lbliii

@lbliii lbliii commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Description

Adds documentation and release notes for PR #1534, which introduces max_calls_per_worker support to mitigate OOM errors caused by lxml/libxml2 memory fragmentation during long-running jusText extraction jobs. Release notes cover the new worker recycling feature and the OOM bug fix. The Common Crawl guide adds the extractor_max_calls_per_worker parameter and a new "Memory Management for Extraction" section with usage examples. The memory management guide cross-links to the new section.

Checklist

  • I am familiar with the Contributing Guide.
  • New or Existing tests cover these changes.
  • The documentation is up to date with these changes.

@lbliii
lbliii requested a review from a team as a code owner March 31, 2026 19:00
@lbliii
lbliii requested review from abhinavg4 and removed request for a team March 31, 2026 19:00
@greptile-apps

greptile-apps Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds release notes and documentation for the max_calls_per_worker worker-recycling feature (PR #1534) that mitigates lxml/libxml2 C-heap fragmentation OOM errors during long-running jusText extraction. Changes cover the new extractor_max_calls_per_worker parameter in the Common Crawl guide, a new "Memory Management for Extraction" section with usage examples, and a cross-link from the memory management reference. Previous review concerns about a duplicate ## Bug Fixes heading and the orphaned Audio Stage Name Propagation subsection are resolved in the current HEAD.

Confidence Score: 5/5

Safe to merge — documentation-only changes with no runtime code affected

All prior P1 concerns from previous review threads (duplicate ## Bug Fixes heading, orphaned Audio Stage Name Propagation subsection) are resolved. The new content is accurate and internally consistent: the extractor_max_calls_per_worker parameter table entry, Memory Management for Extraction section, and memory-management.mdx cross-link all agree. Remaining structural quirk (pre-existing duplicate ## Improvements headings at lines 118 and 167 of the release notes) was not introduced by this PR.

No files require special attention for this PR

Important Files Changed

Filename Overview
fern/versions/v26.04/pages/about/release-notes/index.mdx Adds Worker Recycling (What's New) and JusText OOM (Bug Fixes) entries correctly; a pre-existing duplicate ## Improvements heading (lines 118 and 167) creates duplicate anchors but was not introduced by this PR
fern/versions/v26.04/pages/curate-text/load-data/common-crawl.mdx Adds extractor_max_calls_per_worker parameter row and Memory Management for Extraction section with accurate usage examples and a Note on Ray Data executor scope
fern/versions/v26.04/pages/reference/infrastructure/memory-management.mdx Adds Worker Recycling (Ray Data) bullet with correct cross-link to common-crawl#memory-management-for-extraction; anchor slug matches the heading in common-crawl.mdx

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["CommonCrawlDownloadExtractStage\nextractor_max_calls_per_worker=2 (default for JusText)"] --> B["Ray Data Worker starts"]
    B --> D["Process WARC task\n(jusText/lxml extraction)"]
    D --> C{"task_count >=\nmax_calls_per_worker?"}
    C -- No --> D
    C -- Yes --> E["Recycle worker process\n(reclaim fragmented C-heap)"]
    E --> B
Loading

Reviews (5): Last reviewed commit: "docs: add release notes and docs for jus..." | Re-trigger Greptile

Comment on lines +31 to +36
## Bug Fixes

### JusText Extraction OOM (PR #1534)

Fixed out-of-memory errors during long-running jusText extraction jobs. Memory fragmentation from lxml/libxml2 C-heap allocations caused RSS growth across workers until OOM. Worker recycling via `max_calls_per_worker` now prevents this by restarting worker processes periodically.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Duplicate ## Bug Fixes section

The new JusText OOM entry introduces a second ## Bug Fixes heading at line 31, but an existing ## Bug Fixes section already exists further down the file (after the ## Dependency Updates block, at line 42). This produces two top-level sections with the same title, which breaks document navigation (duplicate anchor IDs) and fragments the bug-fix list for readers.

The JusText OOM entry should be moved inside the existing ## Bug Fixes section so both fixes live together. Remove this standalone ## Bug Fixes heading and its content block here, and instead add a ### JusText Extraction OOM (PR #1534) subsection inside the existing ## Bug Fixes section (currently at line 42), alongside ### Audio Stage Name Propagation (PR #1470).

@lbliii
lbliii force-pushed the lbliii/docs-justext-oom-fix branch from 769fc94 to 93b5972 Compare March 31, 2026 19:13
Comment on lines 37 to 44
## Dependency Updates

- **Cosmos-Xenna**: Updated from 0.1.2 to 0.2.0 with simplified resource model
- **Ray**: Updated to 2.54

## Bug Fixes

### Audio Stage Name Propagation (PR #1470)

Fixed audio pipeline stage names not propagating in `StagePerfStats`, making benchmark output unable to identify per-stage timing. All audio stages (`GetAudioDurationStage`, `PreserveByValueStage`, `AudioToDocumentStage`, `GetPairwiseWerStage`) now correctly report their names, and stage performance history persists when stages create new task objects.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Audio Stage Name Propagation is orphaned under Dependency Updates

When fixing the duplicate ## Bug Fixes heading, the original ## Bug Fixes heading that preceded ### Audio Stage Name Propagation was removed but the subsection itself was kept in place. As a result, ### Audio Stage Name Propagation (PR #1470) now sits directly inside the ## Dependency Updates section with no parent bug-fixes heading — it reads as a dependency update, not a bug fix.

The correct fix is to consolidate both bug-fix entries under a single ## Bug Fixes section. One clean approach is to restore the ## Bug Fixes heading after ## Dependency Updates and place both subsections inside it:

Suggested change
## Dependency Updates
- **Cosmos-Xenna**: Updated from 0.1.2 to 0.2.0 with simplified resource model
- **Ray**: Updated to 2.54
## Bug Fixes
### Audio Stage Name Propagation (PR #1470)
Fixed audio pipeline stage names not propagating in `StagePerfStats`, making benchmark output unable to identify per-stage timing. All audio stages (`GetAudioDurationStage`, `PreserveByValueStage`, `AudioToDocumentStage`, `GetPairwiseWerStage`) now correctly report their names, and stage performance history persists when stages create new task objects.
## Dependency Updates
- **Cosmos-Xenna**: Updated from 0.1.2 to 0.2.0 with simplified resource model
- **Ray**: Updated to 2.54
## Bug Fixes
### JusText Extraction OOM (PR #1534)
Fixed out-of-memory errors during long-running jusText extraction jobs. Memory fragmentation from lxml/libxml2 C-heap allocations caused RSS growth across workers until the process ran out of memory. Worker recycling through `max_calls_per_worker` now prevents this by restarting worker processes periodically.
### Audio Stage Name Propagation (PR #1470)

This removes the standalone ## Bug Fixes block introduced above ## Dependency Updates and reunites both bug-fix entries under one correctly placed section.

Comment on lines +27 to +29
- **Automatic Worker Recycling for JusText**: `CommonCrawlDownloadExtractStage` now defaults to `extractor_max_calls_per_worker=2` when using `JusTextExtractor`, automatically restarting worker processes every two tasks to reclaim fragmented memory.
- **Configurable `max_calls_per_worker`**: `DocumentIterateExtractStage` accepts a new `max_calls_per_worker` parameter that instructs the Ray Data executor to restart worker processes after a specified number of tasks. This is useful for any extraction stage that uses C libraries prone to heap fragmentation, such as lxml.
- **`extractor_max_calls_per_worker` on Composite Stages**: `DocumentDownloadExtractStage` and `CommonCrawlDownloadExtractStage` expose this setting through `extractor_max_calls_per_worker`, which propagates to the underlying iterate-extract stage.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems pretty verbose. I'm okay with having smaller 1-2 line sections here unless more descriptive options and preferred that'll be summarized later on


### JusText Extraction OOM (PR #1534)

Fixed out-of-memory errors during long-running jusText extraction jobs. Memory fragmentation from lxml/libxml2 C-heap allocations caused RSS growth across workers until the process ran out of memory. Worker recycling through `max_calls_per_worker` now prevents this by restarting worker processes periodically.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lbliii Do you have a preference on keeping it in both places or just one?

@copy-pr-bot

copy-pr-bot Bot commented Apr 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Addresses PR #1697 review feedback:
- Condensed "What's New" entry to 1-2 lines (ayushdg verbosity feedback)
- Consolidated all bug fixes under single "## Bug Fixes" section
- Fixed "Audio Stage Name Propagation" being orphaned under "Dependency Updates"
- Kept feature in "What's New" and bug fix in "Bug Fixes" as separate concise entries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Lawrence Lane <llane@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants