Avatar for the PrefectHQ user
PrefectHQ
prefect
BlogDocsChangelog

Branches performance

Pull requests

Log PermissionError when UI static directory creation fails#21035
last run
3 hours ago
Log PermissionError when UI static directory creation fails When running in HA with a read-only site-packages directory, the OrchestrationClient would fail silently when trying to create the UI static directory. The PermissionError was propagated up and eventually sent to the dead letter queue without any clear error message. This change catches PermissionError in create_ui_app() and logs a clear error message with the path and resolution (setting PREFECT_UI_STATIC_DIRECTORY to a writable location).
13 hours ago
9169bc6
Br1an67:fix/issue-19317-log-ui-static-dir-error
CodSpeed Performance Gauge
0%
Add bounded queue for EventsWorker to prevent OOM during server outages#21034
last run
3 hours ago
Add bounded queue for QueueService to prevent OOM during server outages When the Prefect API server is unreachable for extended periods, the in-memory event queue in EventsWorker grows without bound, eventually causing OOM kills in long-running worker processes. This change adds: 1. A `_max_queue_size` class variable on `_QueueServiceBase` (default 0, meaning unbounded) that subclasses can override to set a queue bound. 2. A `try/except queue.Full` in `QueueService.send()` that drops items with a warning log instead of blocking or crashing. 3. A new `PREFECT_EVENTS_WORKER_QUEUE_MAX_SIZE` setting (default 10000) in a new `EventsSettings` model, which `EventsWorker` reads to configure its queue bound. 4. The `reset_for_fork()` method preserves the maxsize when recreating the queue in child processes. The change is fully backward-compatible: existing QueueService subclasses keep `_max_queue_size=0` (unbounded), and users can set the env var to 0 to restore the previous unbounded behavior. Closes #21031
3 hours ago
98c649a
zionts:fix/bounded-events-queue
CodSpeed Performance Gauge
0%
Add bounded queue support to QueueService to prevent OOM Adds a `_max_queue_size` class variable to `_QueueServiceBase` (default 0 = unbounded, preserving current behavior). When set, the internal `queue.Queue` is created with that `maxsize`. If the queue is full, `QueueService.send()` drops the item with a warning instead of blocking. Adds a `PREFECT_CLIENT_EVENTS_QUEUE_MAX_SIZE` setting that `EventsWorker` reads to configure its queue bound. This prevents unbounded memory growth when the Prefect server is temporarily unreachable during long-running flows. Closes #21031
4 hours ago
6fbc21d
zionts:fix/bounded-events-worker-queue
CodSpeed Performance Gauge
0%
Add PREFECT_CLIENT_EMIT_EVENTS setting to disable client-side event emission Adds a new `client.emit_events` boolean setting (env var `PREFECT_CLIENT_EMIT_EVENTS`) that controls whether the client emits events to the Prefect server. Defaults to `True` (no behavior change). When set to `False`, `should_emit_events()` short-circuits and returns `False` before checking API URL/key configuration, preventing any events from being created or queued. This is useful for long-running flows that don't rely on event-driven features (automations, triggers) and want to reduce memory usage from the EventsWorker queue. Closes #21030
4 hours ago
2e5c260
zionts:fix/emit-events-setting
CodSpeed Performance Gauge
0%
© 2026 CodSpeed Technology
Home Terms Privacy Docs