Repository navigation
Fix crash in log file rotation when the process has no free file descriptors - #130517
Conversation
`ArchiveStrategy::archive` deletes the current `LogFile` before it opens the new one. When that open and the fallback `newLogFile` both failed with EMFILE, `FileChannel::_pFile` kept pointing to the deleted object, and the next message crashed in `LogFileImpl::sizeImpl`. Closes: ClickHouse/clickhouse-core-incidents#1699
|
Workflow [PR], commit [2e68ea5] Summary: ✅
AI ReviewSummaryThe PR prevents Missing context / blind spots
Final Verdict✅ Approve — no correctness or safety issues found in the current diff. |
|
LGTM |
|
Backport labels have been automatically added based on https://github.com/clickhouse/clickhouse-core-incidents/issues/1699 Labels added:
These labels ensure backport PRs are properly created for each affected release version. The release automation will create backport PRs as needed based on these labels. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units20 translation units recompiled, 108 s compile time in total, 20 of them have a recent master baseline. |
Backport #130517 to 26.8: Fix crash in log file rotation when the process has no free file descriptors
Backport #130517 to 26.9: Fix crash in log file rotation when the process has no free file descriptors
Backport #130517 to 26.3: Fix crash in log file rotation when the process has no free file descriptors
Backport #130517 to 26.10: Fix crash in log file rotation when the process has no free file descriptors
…hen the process has no free file descriptors
…cess has no free file descriptors
…cess has no free file descriptors
…cess has no free file descriptors
…ocess has no free file descriptors
ArchiveStrategy::archivedeletes the currentLogFilebefore it renames the files and opens a new one. When the process has no free file descriptors, that open throws, the fallbacknewLogFileinPoco::FileChannelthrows too, and_pFilekeeps pointing to the deleted object. The next log message reads freed memory inLogFileImpl::sizeImpl, and the server crashes with SIGSEGV. Now_pFileis reset beforearchive. While descriptors are exhausted, the log file loses messages, and logging recovers when descriptors are free again.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a server crash (SIGSEGV in
Poco::LogFileImpl::sizeImpl) when the log file was rotated while the process had no free file descriptors.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/130517]
Version info
26.11.1.1889-master(included in26.11and later)