Saltar al contenido

#506 Raft, Rust, and release day

25 de noviembre de 2026 · 31 min

Notas del episodio

Topics covered in this episode:
Watch on YouTube

About the show

Sponsored by LongLink: Open-source platform for building and running custom business applications with Python and FastAPI

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesday at 7am PT. Older video versions available there too.

Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.

Calvin #1: De-fanging dangerous triggers in GitHub Actions across an organization

  • GitHub will block pull_request_target by default in public repos starting Dec 2, 2026. GitHub announced this in its changelog on Nov 2; it isn't in effect yet. That default stops applying once you set your own event policy.
  • Two triggers are the main danger. pull_request_target and issue_comment both run with a token that can write to the repo and with the repo's secrets. The classic "pwn request" is a workflow that checks out a stranger's PR code and runs it.
  • It's not theoretical. Ultralytics (Dec 2024), LiteLLM and Telnyx via Trivy (Mar 2026), and elementary-data (Apr 2026), where a single crafted PR comment led to a malicious release on PyPI.
  • To get started, the first step is an Actions event policy. On GitHub Team or Enterprise, one org-wide policy allows only the triggers you expect: pull_request, push, release, repository_dispatch, schedule, workflow_dispatch, workflow_run.
  • Start in Evaluate mode. It blocks nothing and logs what would have been blocked under "Policy insights". Leave it on long enough to cover a release and your least frequent scheduled job.
  • Free plans have to do it repo by repo. You apply the same policy through gh api /repos/$repo/actions/policies. New repos have no policy until someone adds one.
  • Find what you have: gh search code pull_request_target path:.github/workflows --owner YOUR-ORG, also search for issue_comment and then zizmor to check each repo's workflows.
  • PSF status: the policy is set up for the pypi org. In the python org, Seth Larson is still migrating the last few repos before turning it on. The post's intro says all three orgs are done; I'm going by the body, which is more specific.

Michael #2: RQlite - The fault-tolerant relational database built on SQLite.

rqlite is a self-hosted distributed relational database built on SQLite and the Raft consensus protocol. It puts SQLite behind an HTTP API and replicates data across machines. For Python developers, the appeal is familiar SQL and lightweight deployment, with a database that can survive a server failure.

  • Keep SQLite's SQL, add high availability. A three-node cluster can survive one node failing, provided the remaining nodes can communicate.
  • Python applications send SQL and parameters over HTTP as JSON. Integrations include pyrqlite and sqlalchemy-rqlite; check client capabilities before migrating existing code.
  • Deployment is a single binary per node, with Docker and Kubernetes options. Features include full-text search, JSON support, SQLite extensions, change data capture, and automated cloud backups.
  • Replication does not scale writes. Every write goes through the leader and Raft log, adding network and disk overhead compared with standalone SQLite.
  • Transactions must fit within one HTTP request. You can execute a batch atomically, but cannot hold a transaction open across requests. Explicit BEGIN/COMMIT/ROLLBACK control is unsupported.
  • Read consistency is configurable: default Weak normally reads from the leader; Linearizable adds quorum checks; None permits potentially stale local reads. Stronger guarantees cost coordination.
  • Discussion angle: when does SQLite need clustering rather than just backups? Proposed demo: write from Python, stop the leader, then show the surviving cluster accepting requests after election.

SPONSOR SEGMENT: LongLink

Michael #3: diskcache-oxide now supports Django

diskcache-oxide plugs into Django’s existing cache framework for page caching, template fragments, low-level cache calls and sessions. Worker processes on the same machine share one cache on disk, with atomic counters across processes. The appeal is keeping Django’s familiar caching API without running Redis or Memcached.

  • Setup uses the package’s django extra, diskcache_oxide.DjangoCache as the backend, and an absolute directory for LOCATION. Existing Django cache calls stay the same; optional sharding spreads contention across multiple cache files.
  • Keep disposable pages separate from session state. The recommended configuration uses two aliases and directories: page-cache failures become misses or dropped writes, while session writes raise on failure and sessions are not evicted for size. The backend rejects session configurations that silently drop writes.
  • The companion Django example runs four Gunicorn workers and demonstrates cached views, template fragments, sessions and a shared visit counter. Response headers identify which worker answered, and multiprocess tests check concurrent increments, sessions across workers and caches opened before forking.
  • This shares a cache across processes on one machine, not across a fleet. Django’s get_or_set() can still compute twice when workers miss together. A cached view that reads sessions also needs vary_on_cookie to avoid serving one visitor’s personalized response to everyone.

Calvin #4: Muru: an AI-assisted Rust server for Python apps from mod_wsgi's creator

Simon Willison's post (repo: muruhq/muru · author's series: Twenty years of mod_wsgi)

  • What it is: Muru is Graham Dumpleton's successor to mod_wsgi, 20 years after he started writing mod_wsgi in December 2006. It's not an Apache module and not another server you put behind nginx. He means it to handle running a Python web app from your laptop through to production.
  • The parts: muructl is a single Rust binary that handles HTTP/1.1, HTTP/2, TLS, static files and compression, and never runs Python. A Python host process imports your app once and forks workers from it. A controller decides what runs and is never on a request's path.
  • It hosts more than WSGI: ASGI and gRPC too, all in one app. Requests can be handed from WSGI to ASGI, so an existing WSGI app can add websockets without a rewrite. Flask and Django run unmodified, e.g. muructl run mysite.wsgi:application.
  • Every deploy is a new release: a release starts next to the old one and traffic moves only once it's ready. If the new code won't even import, the old release just keeps serving. Even dev-mode auto-reload works this way, and the same mechanism gives you blue/green, canaries and rollback.
  • It understands Python apps: the access log splits waiting time (queue=, every thread was busy) from your code's time (app=), so you can tell "add capacity" from "fix slow code". Each scaling policy can scale workers to zero and optionally stop the host process too.
  • Fun tie-in with the lazy-imports story: his "when lazy imports help" post argues that PEP 810 lazy imports can hurt a pre-forking web server. Deferred modules load separately in each worker, so they aren't shared through copy-on-write memory. Muru measures import costs per app instead of guessing.
  • Status: alpha, pre-releases only. Install with uv tool install muructl. It runs on Linux and macOS with CPython 3.11+, including free-threaded builds, and is Apache-2.0 licensed.
  • The AI angle: Dumpleton says most of the code was written by AI, while he handles design, review and steering. It's about a month old, and he's in the Claude for Open Source Program. He doesn't accept patches: "don't send me a patch, just describe the problem." Quote: "deciding what isn't good enough yet is still down to me, and twenty years of getting things wrong with mod_wsgi turns out to be useful for that."

Extras

Michael:

  • Black Friday is on at Talk Python Training
  • My first CPython issue
  • PyCon US 2027 call for proposals is open
  • nginx2root - patch your nginx now
    • Credit Jake Howard
    • F5 shipped nginx 1.31.9 (mainline) and 1.30.7 (stable) on November 18, 2026. They fix five memory-corruption bugs that Xint named nginx2root. Each one is a path to unauthenticated remote code execution. If nginx fronts your Python apps, check your version today.
      • The big one is CVE-2026-123007, an integer underflow in HTTP/2 flow control. It has been in every release since HTTP/2 landed in 1.9.5 in 2015, and a reachable TLS port with HTTP/2 on is enough.
      • Exposure is huge. Xint counted 11.94 million nginx hosts on Shodan that report a version, and 98.9% were in the affected range.
      • The fix is to upgrade. Setting http2 off; is a stopgap that blocks only two of the five. The other three hit the DNS resolver, HTTP/3, and the mail proxy.
      • Docker does not save you. Xint chained the nginx bug with an unpatched Linux kernel SCTP flaw to go from the nginx worker in a container to root on the host. Block the sctp kernel module if you don't use it.
      • AI found most of it. Four of the five came from Xint's autonomous scanner with no human steering, and Wiz found the HTTP/2 pair with its AI code scanning harness. Xint and Wiz are withholding their exploits and no attacks in the wild are reported, but some outlets say a public PoC hit GitHub the same day.

Joke: What they think grid

Todos los episodios de Python Bytes

Ajustes

Visualización

Idioma

Determina qué emisoras ves primero en la página de inicio.

Historial

Las emisoras y episodios escuchados recientemente y tus últimas búsquedas solo se guardan en este navegador.

Avisos

Un breve aviso cuando un pódcast que sigues tiene un episodio nuevo. Puedes desactivar pódcast concretos con la campana de su página.

Cuenta

Guarda tus favoritos: en la app y en la web.

Atajos de teclado

/
Abrir búsqueda
Espacio
Reproducir o pausar
← →
En el reproductor: 15 s atrás, 30 s adelante (episodios) · en una fila: siguiente tarjeta
↑ ↓
En una fila: destino dentro de la tarjeta
Inicio / Fin
En una fila: primera o última tarjeta
Esc
Cerrar ventana o menú
?
Este resumen
Reproduciendo ahora

Ir a la emisora

A continuación

    Añade episodios con «A continuación»: sonarán después del episodio actual.