Skip to content

fix: clean up temporary LOB files after each row during indexing - #639

Open
luis100 wants to merge 1 commit into
masterfrom
fix/638-cleanup-lob-temp-files
Open

fix: clean up temporary LOB files after each row during indexing#639
luis100 wants to merge 1 commit into
masterfrom
fix/638-cleanup-lob-temp-files

Conversation

@luis100

@luis100 luis100 commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • DbvtkExportModule.handleDataRow() never called cleanResources() on BinaryCell input stream providers after converting/indexing a row.
  • Temp files created via TemporaryPathInputStreamProvider (Files.createTempFile("dbptk", "lob")) for LOBs embedded in table.xml were therefore only removed by JVM shutdown hooks, letting /tmp grow to hundreds of gigabytes while indexing SIARDs with many LOBs.
  • Added the same per-row cleanup loop already used by dbptk-developer's SinkModule.handleDataRow(): iterate the row's cells and call cleanResources() on each BinaryCell after it has been converted (its content is already read/copied into the row sent to Solr by ToolkitStructure2ViewerStructure.getRow(), so this is safe). PathInputStreamProvider.cleanResources() (used for externally-stored LOBs) is a no-op, so external LOB files are left untouched.

Fixes #638

Test plan

  • mvn compile succeeds
  • Index a SIARD with many embedded LOBs and confirm /tmp/dbptk*lob files no longer accumulate during indexing (only transient per-row temp files should exist at any time)

🤖 Generated with Claude Code

DbvtkExportModule.handleDataRow() never called cleanResources() on
BinaryCell input stream providers, so temp files created by
TemporaryPathInputStreamProvider (Files.createTempFile("dbptk", "lob"))
were only deleted by JVM shutdown hooks. This let /tmp grow to
hundreds of gigabytes when indexing SIARDs with many embedded LOBs.

Mirrors the cleanup loop already used in dbptk-developer's
SinkModule.handleDataRow().

Fixes #638
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. type: bug labels Aug 4, 2026
@luis100
luis100 requested a review from LizardLump August 4, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files. type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temp files created from LOBs not cleaned up until program shutdown

2 participants