Use single-threaded zstd compressor
This commit is contained in:
parent
2ca12c0096
commit
62d2326933
2 changed files with 5 additions and 1 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- zstd compression uses a fresh `zstandard` compressor/decompressor per call instead of shared module-level singletons, fixing process segfaults when ingester workers compress documents concurrently (Python < 3.14).
|
||||||
|
|
||||||
## [0.61.0] - 2026-06-23
|
## [0.61.0] - 2026-06-23
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ except ImportError:
|
||||||
# _prepare_document_from_docling), so construct a fresh instance per call
|
# _prepare_document_from_docling), so construct a fresh instance per call
|
||||||
# rather than sharing a module-level singleton.
|
# rather than sharing a module-level singleton.
|
||||||
def _zstd_compress(data: bytes) -> bytes:
|
def _zstd_compress(data: bytes) -> bytes:
|
||||||
return ZstdCompressor(threads=-1).compress(data)
|
return ZstdCompressor().compress(data)
|
||||||
|
|
||||||
def _zstd_decompress(data: bytes) -> bytes:
|
def _zstd_decompress(data: bytes) -> bytes:
|
||||||
content_size = get_frame_parameters(data).content_size
|
content_size = get_frame_parameters(data).content_size
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue