Skip to content

v0.0.3 - sendfile, and telemetry that arms late

Choose a tag to compare

@Kludex Kludex released this 11 Aug 12:53
· 77 commits to main since this release
46773d9

📁 sendfile

zuvloop 0.0.3 implements the two loop methods that previously raised NotImplementedError.

pip install zuvloop==0.0.3
  • sendfile() and sock_sendfile() use the sendfile(2) system call (#53) - the kernel moves the bytes, nothing is copied through Python. For sendfile(transport, ...) the loop first lets the transport's buffered writes drain and pauses reading, so the file cannot reorder around data written before it; readiness is polled through a duplicate of the descriptor, since libuv allows one handle per descriptor.
  • Targets the syscall cannot serve fall back to a read-and-write loop - a BytesIO, a TLS transport, a pipe - or raise under fallback=False, matching asyncio. On macOS, sendfile(2) does not serve AF_UNIX sockets, so unix connections take the fallback there transparently (native on Linux).

🔭 Telemetry survives late configuration

  • OpenTelemetry providers installed after the loop starts are now noticed (#54). Slow-callback monitoring and the loop gauges were armed once, at run_forever() entry - an application calling logfire.configure() from inside main() silently lost both for the life of the process. The loop's unreferenced native sampler now doubles as the re-check: monitoring arms within one metrics_interval (10s by default) of a provider appearing, the answer is latched so the probe stops once it says yes, and uninstrumented programs keep the native fast path with no per-callback clock reads.
  • Slow-callback spans are warnings now, not errors (#54). OpenTelemetry span status has no warning level, so the status stays unset and the severity travels as a logfire.level_num attribute, which backends that do not know it ignore.

🏗️ Release plumbing

  • The version now comes from the git tag (#52) via hatch-vcs; publishing this release is what stamps 0.0.3 onto the wheels.