Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
==========================================
- Coverage 73.19% 67.86% -5.33%
==========================================
Files 58 62 +4
Lines 3193 3772 +579
==========================================
+ Hits 2337 2560 +223
- Misses 856 1212 +356
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
API plugin settings (host, port, debug, allow_origin) are now overridden if the corresponding CLI flags are explicitly provided, even when an Api instance is defined outside the default behaviour.
|
Hi! I saw that you mentioned django-tasks compatibility on this PR but couldn't find any reference about it on the code. Do you mind committing those changes or maybe open a new PR with it (to avoid getting this one so large). I was playing around with chancy and also have a semi-functional implementation and it would be nice to see how you managed some issues I've been encountering. Great project btw! |
Respect CLI flags for API plugin configuration
|
@TkTech We just started leveraging chancy and super excited for this new dashboard! Any outstanding items you're looking for help with? |
It's been running for testing in a production environment since Monday, so I'd say we'll release this weekend if all goes well. |
I've left some comments in the #82 ticket regarding this, there are some behavioral Qs to answer before we commit to anything. |
We had partially transitioned to UUIDs in v0.25, this completes the work and adds a regression test and closes #84. Also adds some Executor utilities to the public API for getting and iterating the current job pool.
…g test in the test_scale regression catcher.
…pports cancellation.
…mance of two slow tests.
…efix we found along the way.
UUID-Everywhere
…e job multiple times in different batches of the same run.
…creasing its size (735kb -> 2.38MB)
…his was always the contract, but improperly implemented.
…cks. Applied automatic fixes as well as many context wrapping.
Pushing jobs whose unique keys already exist takes row locks through the ON CONFLICT ... DO UPDATE clause, and the worker's batched job updates take row locks too. When the two transactions overlapped and locked the same rows in a different order, Postgres killed one of them with DeadlockDetected, failing the push or the update batch. Both code paths now sort by the same key before touching rows: pushes insert in unique_key order (returning references in the caller's order), and the worker sorts its pending updates by (unique_key, id). A regression test replays the interleaving deterministically. Co-authored-by: audecasteigts <aude.casteigts@gmail.com>
…#46) Custom executors need a supported way to inject their own keyword arguments (database pools, clients, ...) into every job they run. The built-in executors resolved the function through a private static helper that ignored subclass overrides, so the public get_function_and_kwargs was never consulted. get_function_and_kwargs is now a classmethod holding the resolution logic, and prepare_job_for_execution goes through it for every executor. The job-context detection used by co-operative time limits now checks the resolved kwargs for the job instance instead of a side channel, so overrides cannot break it. Because job_wrapper and prepare_job_for_execution are classmethods, the override runs on the side that executes the job (event loop, pool thread, sub-interpreter or child process); nothing crosses that boundary beyond the executor's importable name. The docstring spells this out and an end-to-end test checks the injection on every built-in executor. Co-authored-by: PaulM5406 <ppsmilesi@protonmail.com>
|
Hi @TkTech, I'm a colleague of @AudeCstg and @PaulM5406 at Ouihelp. We run Chancy in production (8 queues, ~60 job types, ~50 cron schedules) on a patched 0.25.0 and would very much like to be back on a stock release. Concretely:
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -103,11 +103,15 @@
- name: Installing dependencies (Python)
run: uv sync --all-extras
+ # Django 6 (the version resolved by `uv sync --all-extras`) refuses to
+ # connect to PostgreSQL < 15, so the Django tests only run on the newer
+ # PostgreSQL of the matrix. Chancy itself still supports 14.
- name: Running tests (parallel)
run: |
- uv run pytest -n auto -v --cov=chancy --cov-report=xml
+ uv run pytest -n auto -v --cov=chancy --cov-report=xml ${{ matrix.pg == '14' && '--ignore=tests/contrib/django' || '' }}
- name: Running Django ORM tests (sequential)
+ if: matrix.pg != '14'
run: |
uv run pytest tests/contrib/django/test_models.py -v --cov=chancy --cov-report=xml --cov-appendIf it helps get 0.26 out, we're happy to take on some of the open issues you'd want in the release. Let us know what would be most useful. |
|
Heya @luca-montaigut. Unfortunately I was caught in a layoff, and so the various OSS projects had to take a back seat for a bit. I'll take a look at #90 and #46. For the test failures, rather than just ignoring 14 we'd rather expand the matrix to also specify the supported postgres version range, since both those django versions and PG14 are still supported (until November 12, 2026, at which time it'll be dropped). Thanks for your patience! Unfortunately v0.26 took far too long to ship. |
Shutdown is now repeatable and re-entrant. Write updates in the outbox in order, so newer runs that rapidly ran after a cancel or failuer cannot be overwritten. Executor cleanup no longer blocks the event loop. Added a public `Worker.flush()` to explicitly drain the queue.
…-subclass' of github.com:PaulM5406/chancy into PaulM5406-enabling-overriding-get_function_and_kwargs-in-executor-subclass
…e* typically safe.
…n-executor-subclass' into 26_ux
|
The sporadic test hangs on 3.11 seem to be this upstream bug in CPython python/cpython#86296. Specifically, deep down inside of psycopg it's using |
Hey @TkTech, |
Thanks @PaulM5406! An upstream psycopg release fixes this in 3.3.6 which was put out yesterday. I believe with uv I can do CPython version-specific pinning, so we can fix this by just requiring >=3.3.6 on 3.11. |

(This is a huge release, changelog to come. WIP)
0.26.0
✨ Improvements
push()in a loop instead of a singlepush_many())🐛 Fixes