fix(confluent): publish(None) should send a real Kafka tombstone#2932
Merged
Conversation
encode_message() turns None into b, so a delete on a compacted topic never actually reaches the broker as a null value. Compaction only reclaims a key on a literal null - an empty-but-present payload just sits there forever. Skip the codec when the body is None so the raw producer gets what it needs to do this properly.
a1976c2 to
19df9ef
Compare
Mirror the confluent fix in the aiokafka producer. Unlike confluent, aiokafka rejects records with neither key nor value, and publish(None) without a key is valid API usage (covered by test_publisher_after_connect), so only keyed None bodies bypass the codec and become tombstones. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
uvicorn 0.51 removed the `target` argument from Multiprocess and Process — Process now builds its own Server from the config. Detect the new signature at import time and construct both objects accordingly, keeping compatibility with uvicorn>=0.34.3. This unbreaks main CI (tests/cli asgi multi-worker tests fail on every run since uvicorn 0.51 released) and the reported CLI crash `TypeError: Multiprocess.__init__() got an unexpected keyword argument 'target'`. Fixes ag2ai#2930 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Lancetnik
approved these changes
Jul 13, 2026
3 tasks
aradng
added a commit
to aradng/FastLoom
that referenced
this pull request
Jul 13, 2026
Tracking main means the resolved commit silently drifts on every poetry lock, and this is production infra - reproducible builds matter more than always-latest. Pin to 9d54a6d8, the commit that includes ag2ai/faststream#2932, and re-lock explicitly when it's time to move (e.g. once #2933 merges too). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
aradng
added a commit
to aradng/FastLoom
that referenced
this pull request
Jul 13, 2026
* fix: depend on faststream's git main for the real tombstone fix ag2ai/faststream#2932 (the actual upstream fix for publish(None, ...) not sending a real Kafka null value) is merged to main but not yet in a PyPI release. Point the kafka extra at git+https://github.com/ag2ai/ faststream.git@main instead of waiting, and drop the runtime monkeypatch in depends.py entirely - the real fix now lives upstream, so there's nothing left to patch. Bumps to 0.4.49. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: pin faststream to an exact commit instead of tracking main Tracking main means the resolved commit silently drifts on every poetry lock, and this is production infra - reproducible builds matter more than always-latest. Pin to 9d54a6d8, the commit that includes ag2ai/faststream#2932, and re-lock explicitly when it's time to move (e.g. once #2933 merges too). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Merged
3 tasks
aradng
added a commit
to aradng/FastLoom
that referenced
this pull request
Jul 13, 2026
… refs (#18) 0.4.49's publish failed: PyPI's upload validation hard-rejects any package declaring a direct git/URL dependency (HTTP 400 "Can't have direct dependency"). That's not a config issue - it's a policy PyPI enforces on every upload, so pointing the kafka extra at faststream's git main broke the publish step for good, not just this one release. Revert to a plain "faststream[otel,confluent]" PyPI dependency and restore the AsyncConfluentFastProducerImpl.publish() monkeypatch from 0.4.48. ag2ai/faststream#2932 is merged upstream but has no PyPI release yet, so the shim stays until one exists. Bumps to 0.4.50 (0.4.49 never actually published - the tarball was rejected before completing). Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
publish(None, ...)doesn't actually produce a Kafka tombstone right now -encode_message()turnsNoneintob""before it reaches the producer. For a compacted topic that means log compaction never reclaims the key: an empty-but-present value just stays forever, only a literal null does the job.This skips the codec when the body is
Noneand lets the raw producer send an actual null value instead.Added a test that reproduces it (fails on main with
assert b'' is None, passes with the fix).