mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
Peak memory: take one best-effort concluding sample when the stdout read reaches EOF (fired once via a guard in the read buffer), so a peak reached just before the function closes stdout is captured. This is not continuous coverage of the post-output reap — it is documented as a single best-effort tail reading. A short-lived UDF that writes small output and exits before ClickHouse drains stdout may still report a near-zero peak; this is documented in the event description and on the sampler. ShellCommand: capture the reaped child's CPU times by value at reap time instead of heap-allocating after the child has exited, so a memory-limit `exception` can no longer fail a query whose child already finished successfully. UDFProcessSubtreeSampler: the executable path no longer raises the "PeakMemoryByteSeconds will under-count" degradation flag on a `readPeakRss` failure — the child's lifetime is not under our control, so a failed read is usually a legitimately-exited child rather than a sandbox denial. The pool path, where the borrowed worker is provably alive during sampling, still flags it. Also correct stale doc comments (the sampler lifecycle bullet and `recordExecutableFinished` idempotency), clarify the `pollPid` timeout-vs-error return, and remove the post-EOF exclusion test whose assertion no longer matches the best-effort tail contract.