Silence retryable SQLite lock errors from docket.worker logger
The existing fix in PR #18957 only filtered SQLite lock errors from the
uvicorn.error logger. However, when using flow.serve() with SQLite,
background tasks like mark_deployments_ready run through docket and log
errors through the docket.worker logger, which was not covered.
This change extends the SQLite lock log filter to also filter the
docket.worker logger, silencing the noisy but harmless 'database is locked'
errors that users see during onboarding.
Closes #19771
Co-Authored-By: Nate Nowack <nate@prefect.io>
fix: properly drain workers in prefect_test_harness when used in async contexts
Fixes #19762
When prefect_test_harness is used in an async context, the drain_all() and
drain() methods return coroutines that were never awaited, causing
RuntimeWarning: coroutine 'wait' was never awaited.
This fix uses the underlying _drain() method which returns a
concurrent.futures.Future that can be waited on synchronously, regardless
of whether there's a running event loop. This avoids creating unawaited
coroutines in the first place.
Changes:
- Use _drain() instead of drain()/drain_all() in prefect_test_harness cleanup
- Wait synchronously on the futures with concurrent.futures.wait()
- Copy EventsWorker instances before iterating to avoid dictionary mutation error
- Add regression test that fails if unawaited coroutines are created
Co-Authored-By: Nate Nowack <nate@prefect.io>
feat: convert proactive triggers to docket perpetual function and remove LoopService
- Convert ProactiveTriggers LoopService to evaluate_proactive_triggers_periodic perpetual function
- Remove LoopService class and run_multiple_services from base.py entirely
- Update test_service_subsets.py to remove ProactiveTriggers from Service class tests
- Delete test_loop_service.py (no longer needed)
- Update CLI and perpetual_services.py docstrings to remove LoopService mentions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
feat: add generic typing support for Variable.get method
This adds optional explicit typing for the Variable.get and Variable.aget methods,
allowing users to declare the expected type when retrieving a variable:
var = Variable[str].get('my_variable')
The implementation:
- Makes Variable class generic with TypeVar T bounded to StrictVariableValue
- Uses TypeVar default for backward compatibility (unparameterized Variable still works)
- Adds overloads for get/aget to properly type the return value based on whether
a default is provided
- Both sync (get) and async (aget) methods support the same typing behavior
Closes #19752
Co-Authored-By: Nate Nowack <nate@prefect.io>