11# 3.0.0 (Unreleased)
22
33Breaking Changes
4- * Drop python2 support (#2699 , #2774 , #2837 )
4+ * Drop python2 support (#2699 , #2774 , #2837 , # 2846 )
55* Consumer: use assignor instances, not classes (#2775 )
6+ * KIP-679: Update Producer defaults -- enable_idempotence=True, acks='all' (#3013 )
7+ * KIP-735: Increase default consumer session_timeout_ms from 10s to 45s (#3030 )
8+ * Admin: change response shapes to simple dicts (#2883 )
9+ * Admin: groups apis renames; add offsets, members apis (#2892 )
10+ * Admin: rename MetadataAdminMixin -> ClusterAdminMixin; move log dirs under cluster (#2882 )
11+ * Admin: Deprecate NewTopics/NewPartitions in favor of simple dicts (#2869 )
12+ * Make IncompatibleBrokerVersion a subclass of UnsupportedVersionError (#2924 )
13+ * KafkaError subclass Exception not RuntimeError (#2932 )
14+ * Eliminate NoBrokersAvailableError (#2942 )
15+ * KafkaProtocolError is not retriable (#2941 )
16+ * Rename api_version_auto_timeout_ms -> bootstrap_timeout_ms; default 30s (#3028 )
17+ * Remove kafka.client_async / kafka.conn legacy modules (#2918 )
18+
19+ Networking (kafka.net)
20+ * kafka.net: Refactored async networking modules (generator-based coroutines) (#2812 )
21+ * kafka.net: SSL transport support (#2813 )
22+ * kafka.net: SASL authentication support (#2814 , #2886 , #2994 , #3026 )
23+ * kafka.net: SOCKS5 proxy support (#2815 )
24+ * kafka.net: HTTP CONNECT proxy support (RFC 7231 s4.3.6) (#2990 )
25+ * kafka.net: Metrics tracking (#2834 )
26+ * kafka.net: Per-request timeouts (#3008 )
27+ * kafka.net: support socket_connection_setup_timeout_ms w/ exponential backoff (KIP-601) (#3027 )
28+ * kafka.net: Network IO thread used by all clients (Admin/Consumer/Producer) (#2965 , #2980 )
29+ * kafka.net: Move io_thread and run() from manager to selector (#2961 , #2968 , #2963 )
30+ * KafkaNetClient: drop-in replacement for KafkaClient using kafka.net (#2816 )
31+ * KafkaNetSocket: interface class for socket and proxy connections (#2992 )
32+ * Future.__ await__ support (#2811 )
33+ * Future: __ slots__ and callback/errback inlining optimization (#2848 )
34+ * Future: clear callbacks/errbacks when done to avoid reference cycles (#2891 )
35+ * Pass task by value when adding call_soon callback to future (#2826 )
36+ * Default SSLContext -> PROTOCOL_TLS_CLIENT; minimum version TLS 1.2 (#2807 )
37+ * Enable TCP KeepAlive as default socket option (#2904 )
38+ * WakeupNotifier primitive for cross-thread/task wakeups (#2925 , #2933 )
39+ * SASL: Prefer node hostname to IP address when building mechanisms (#3003 )
40+ * kafka.net: Validate SASL/SCRAM iterations (#3026 )
41+ * kafka.net.selector: Break scheduled heapq ties when tasks share scheduled_at (#3007 )
42+ * kafka.net.selector: Monitor slow tasks with slow_task_threshold_secs (#2946 )
43+ * kafka.net.selector: Use threading.Lock() to detect concurrent access to poll() (#2945 )
44+ * kafka.net.selector: Track pending tasks to prevent gc before completion (#2950 )
45+ * kafka.net.selector: Support reschedule(when, task); idempotent unschedule (#2939 )
46+ * kafka.net: Raise RuntimeError on concurrent access to net.poll or wakeup() (#2938 )
47+ * kafka.net: Raise RuntimeError on run/call_at/call_soon_threadsafe after closed (#2971 )
48+ * kafka.net: Catch unhandled exceptions in IO thread (#2970 )
49+ * kafka.net: Improve error handling on sock read/write (#2995 )
50+ * kafka.net.transport: Close connection on socket write error (#2973 )
51+ * kafka.net.transport: Fix double EVENT_WRITE register on socket (#2972 )
52+ * kafka.net.transport: Handle OSError on sock when constructing __ str__ (#2926 )
53+ * kafka.net: Fix notify/wakeup race w/ pending flag (#2979 )
54+ * kafka.net: Support get_connection timeout, use for check_version (#2943 )
55+ * kafka.net: Drop manager.poll(); call net.poll directly (#2948 )
56+ * kafka.net: Check locks in _ poll_once; add net.drain() (#2949 )
57+ * kafka.net.manager: Add call_soon(coro) and run(coro) for sync/async bridge (#2862 )
58+ * kafka.net.manager: Bootstrap is sync/blocking (#2919 )
59+ * kafka.net.manager: Close before stopping IO thread; fail pending bootstrap (#2934 )
60+ * kafka.net: Raise UnknownBrokerIdError when connection fails because node_id is not in metadata (#2876 )
61+ * kafka.net: Bootstrap if needed for metadata refresh (#2825 )
62+ * connection: short-circuit send/recv when closed (#2967 )
663
764Protocol
865* Dynamic protocol classes using upstream json schemas (#2727 , #2745 , #2779 , #2782 , #2787 , #2810 )
966* Add .pyi type annotation stubs for generated protocol classes (#2784 )
1067* Protocol encode/decode optimization with inline compile/exec (#2785 )
1168* Protocol benchmarks and profiling (make bench-protocol) (#2783 )
1269* Add UUID protocol type (#2703 )
13- * Fix TaggedFields encoding/decoding (#2725 )
70+ * Add UnsignedInt16 type
71+ * KIP-893: support nullable structs; add DescribeTopicPartitions (#2889 )
72+ * Add DescribeQuorum protocol message
73+ * Fix TaggedFields encoding/decoding (#2725 , #2745 , #2779 )
1474* Fix VarInt/VarLong encoding (#2706 )
75+ * Fix CompactBytes encoding of struct data (#2782 )
76+ * Fix compiled encode_into for None arrays (#2790 )
77+ * Validate network frame size (#3019 )
78+ * Validate DataContainer version (#2759 )
79+ * DataContainer.to_dict() helper (#2758 , #2872 , #2879 )
80+ * Refactor treatment of versioned ApiMessage classes (#2739 )
81+ * Lookup request header -> response class via ResponseClassRegistry (#2730 )
82+ * Store in-flight request headers only for protocol parser (#2723 )
83+ * Combine broker_version/api_versions -> versions.py (#2913 )
84+ * Manual json schema edits to restore fields dropped in Apache 4.0 (#2738 )
1585* Migrate all internal usage to new protocol classes (#2764 , #2765 , #2766 , #2767 , #2768 , #2772 )
1686* Replace kafka.structs BrokerMetadata/PartitionMetadata with MetadataResponse structs (#2794 )
1787* Add ConsumerProtocol data schemas (#2754 )
1888* Add StickyAssignorUserData json schema (#2755 )
19-
20- Networking
21- * kafka.net: Refactored async networking modules (generator-based coroutines) (#2812 )
22- * kafka.net: SSL transport support (#2813 )
23- * kafka.net: SASL authentication support (#2814 )
24- * kafka.net: SOCKS5 proxy support (#2815 )
25- * kafka.net: HTTP CONNECT proxy support (RFC 7231 s4.3.6) (#2990 )
26- * kafka.net: Metrics tracking (#2834 )
27- * KafkaNetClient: drop-in replacement for KafkaClient using kafka.net (#2816 )
28- * Future.__ await__ support (#2811 )
29- * Pass task by value when adding call_soon callback to future (#2826 )
30- * Default SSLContext -> PROTOCOL_TLS_CLIENT; minimum version TLS 1.2 (#2807 )
89+ * Debug log send/recv bytes from protocol parser (#2707 )
90+ * Adjust protocol debug logging; add KAFKA_PYTHON_PROTOCOL_DEBUG_LOG (#2719 )
3191
3292Broker Version Check
3393* BrokerVersionData: consolidated version checks (#2795 )
3494* BrokerVersionData: infer up to 4.2 (#2835 , #2836 )
95+ * BrokerVersionData: support request min/max version (#2868 )
96+ * BrokerVersionData: Fix IncompatibleBrokerVersion errors; add __ str__ (#2804 )
3597* Always send ApiVersionsRequest on connect (#2802 )
3698* Improve ApiVersionsRequest fallbacks (#2803 , #2817 , #2821 )
3799
@@ -40,23 +102,154 @@ Client Bootstrap
40102* ClusterMetadata: bootstrap_brokers(), set_topics/add_topics/metadata_request (#2805 , #2792 , #2796 , #2797 )
41103* Move bootstrap_brokers fallback from brokers() to least_loaded_node() (#2809 )
42104* KafkaClient.least_loaded_node: pass bootstrap_fallback=True if needed (#2830 )
105+ * Consumer: add explicit bootstrap() method (#2975 )
106+ * Admin: explicit bootstrap on __ init__ (#2864 )
107+ * Manage metadata refresh logic in ClusterMetadata via attached manager (#2920 )
108+ * kafka.cluster: End refresh loop on close(); refresh loop catches KafkaError (#2935 , #2936 )
109+ * Respect metadata backoff in KafkaNetClient (#2854 )
43110
44111Consumer
112+ * Consumer: use background thread for all network io; drop HeartbeatThread (#2965 )
113+ * Consumer: send all requests from net io thread (#2980 )
114+ * KIP-429: Incremental Cooperative Rebalance (#2999 )
115+ * KIP-429: Add on_partitions_lost rebalance listener hook (#3016 )
116+ * KIP-320: Detect and handle Log Truncation (#2978 )
117+ * KIP-392: Rack-aware fetch from closest replica (#2986 , #2996 )
118+ * KIP-447: OffsetFetch v7 set require_stable flag if read_committed (#3023 )
119+ * KIP-559: Bump JoinGroup v7 / SyncGroup v5; verify protocol_type/name (#2998 )
120+ * KIP-595: Fetch v12 support; check for log truncation and leader updates in response (#3021 )
121+ * KIP-602: Support client_dns_lookup in Consumer/Producer/Admin config (#3004 )
122+ * KAFKA-7548: Retain fetched data for paused partitions (#2981 )
123+ * KAFKA-9212: Leader Epoch unreliable before Metadata v9 (#2997 )
124+ * Rebalance Listener: raise errors, block fetches on revoked, pre-revoke unsubscribed (#3018 )
125+ * Consumer: call RebalanceListener on close (#3020 )
126+ * Consumer: Retain subscription TopicPartitionState when possible (#3001 )
127+ * Consumer: default request_timeout_ms 30s; use request-specific timeout for JoinGroup (#3011 )
128+ * Consumer: drop max_version clamp on ListOffsetsRequest (#3012 )
129+ * Consumer: handle retriable errors in offsets_for_times (#3022 )
130+ * Consumer: Improve retriable offset fetch error handling (#2977 )
131+ * Consumer: simplify poll() with fetcher.fetch_records (#2960 )
132+ * Consumer: drop poll loop optimizations for pending offset resets and rejoins (#2959 )
133+ * Consumer: _ update_fetch_positions -> _ refresh_committed_offsets; dont poll in position() (#2958 )
134+ * Consumer: use new proto attrs in Fetcher (ListOffsets/Fetch) (#2923 )
135+ * Consumer: convert fetcher reset_offsets/send_list_offsets_requests to async def
136+ * Preserve member id on IllegalGeneration error (#3017 )
137+ * Retry metadata request if tracked topics have retriable errors (#2832 )
45138* Fix KeyError in KafkaConsumer.committed() (#2710 )
46139* Fix ` Fetcher._fetch_offsets_by_times ` retry handling (#2833 )
47- * Retry metadata request if tracked topics have retriable errors (#2832 )
140+
141+ Coordinator
142+ * Coordinator: convert join_group to async def (#2955 )
143+ * Coordinator: convert offset APIs to async (#2951 )
144+ * Coordinator: convert heartbeat loop to async task (#2929 )
145+ * Coordinator: maybe_leave_group_async; LeaveGroupRequest no max-version (#2930 )
146+ * Coordinator: new OffsetFetch/OffsetCommit construction; use manager.send (#2952 )
147+ * Coordinator: new group proto construction; flexible versions (#2954 )
148+ * Coordinator: Drop ready check before FindCoordinatorRequest (#2964 )
149+ * Coordinator: default request_timeout_ms for close() and commit_offsets_sync() (#2974 )
150+ * Coordinator: drop __ del__ (#2931 )
151+ * Dont use OffsetCommitRequest DEFAULT_RETENTION_TIME in coordinator (#2763 )
48152
49153Producer
154+ * KIP-126: Allow KafkaProducer to split and resend oversized batches (#2839 )
155+ * KIP-360 (pt1): Add transaction manager state and helper methods (#2852 )
156+ * KIP-360 (pt2): Bump producer epoch with InitProducerIdRequest v3 on 2.5+ brokers (#2853 )
157+ * KIP-447: Include group metadata in TxnOffsetCommitRequest (#2984 )
158+ * KIP-447: Fixups to align with java client (#2988 )
159+ * KIP-480: StickyPartitioner for KafkaProducer (#2982 )
160+ * KIP-480: Fixup StickyPartitioner edge-cases (#2989 )
161+ * KIP-654: Txn Producer aborts with non-fatal TransactionAbortedError (#3010 )
162+ * KAFKA-5793: Tighten up semantics of OutOfOrderSequenceNumber (pt1) (#2843 )
163+ * Enable producer idempotence with max_in_flight_requests_per_connection > 1 (#2841 )
164+ * Producer: Enforce guaranteed message order when idempotence_enabled (#2937 )
165+ * Producer: treat InvalidProducerEpochError as ProducerFencedError (#2885 )
166+ * Producer: Improve transaction manager retriable error handling (#2884 )
167+ * Producer: Use new-style request construction in Txn Manager (#2983 )
168+ * Refactor producer.send / _ wait_on_metadata for fast path (#2850 )
169+ * Only ensure_valid_topic_name new topics on send (#2849 )
170+ * Avoid unnecessary bytes/bytearray copies on send (#2845 )
171+ * MemoryRecordsBuilder.build() returns bytearray buffer not bytes copy (#2842 )
172+ * Drop PartitionResponse namedtuple; consolidate response and error handling (#2851 )
173+ * Reuse InitProducerIdHandler for idempotent producer
50174* Fixup Sender error class logging (#2828 )
51175
176+ Admin Client
177+ * KIP-516: Initial topic id (uuid) support (#3031 )
178+ * KIP-699: FindCoordinatorRequest v4 -- multi-group support (#3025 )
179+ * KIP-709: OffsetFetch v8 -- use batch interface when available (#3024 )
180+ * Admin: split into functional mixin classes (#2873 )
181+ * Admin: convert request paths to async; cache coordinator_ids (#2851 , #2862 , #2863 , #2866 , #2867 , #2870 , #2871 )
182+ * Admin: describe_metadata_quorum (#2914 )
183+ * Admin: alter_log_dirs (#2912 )
184+ * Admin: cluster features describe/update (#2908 )
185+ * Admin: cluster get_broker_version_data / api_versions (#2903 )
186+ * Admin: list_config_resources (requires 4.1+) (#2900 )
187+ * Admin: support incremental alter configs (#2901 )
188+ * Admin: Improve alter_configs w/ filters and missing keys (#2899 )
189+ * Admin: list_partition_offsets (#2894 )
190+ * Admin: include latest offsets and lag in list_group_offsets; add reset_group_offsets (#2897 )
191+ * Admin: support group state/type filters for list_groups (#2910 )
192+ * Admin: add extended group reset options (#2911 )
193+ * Admin: Expand partitions api support (#2890 )
194+ * Admin: Cleanup alter_partition_reassignments (#3002 )
195+ * Admin: re-use config processing for CreateTopicsResponse
196+ * Admin: Accept topic id (uuid) in _ get_cluster_metadata and describe_topics
197+ * Admin: wait_for_topics() and create_topics() wait_for_metadata option (#2856 )
198+ * Admin: retry delete_records / list_partition_offsets on NotLeaderForPartitionError (#2976 )
199+ * Admin: Fix describe_log_dirs, accept optional topics/brokers (#2881 )
200+ * Admin: refactor _ send_request_to_controller error handling (#2751 )
201+ * Admin mixin fixes and shuffling method ownership (#2877 )
202+ * Admin: Dont return MemberToRemove as key in remove_group_members dict result (#2893 )
203+
204+ CLI
205+ * kafka.cli: common parser args; support sasl/ssl connections (#2887 )
206+ * kafka.cli: common configuration for logging and connect kwargs (#2906 )
207+ * admin cli: acls, users, configs alter (#2888 )
208+ * admin cli: refactor admin group/command parsers; consumer/producer option groups (#2909 )
209+ * admin cli: --id support for describe-topics
210+ * admin cli: close() after running command
211+ * admin cli: dont print stacktrace for BrokerResponseError or ValueError (#2895 )
212+ * admin cli: catch AttributeError and print_help() (#2880 )
213+ * admin cli: fix describe_configs (#2875 )
214+ * Add --enable-logger/--disable-logger to cli options (#2798 )
215+ * Set default cli log level => CRITICAL (#2760 )
216+
217+ Compatibility / Misc
218+ * Support context manager interface for consumer/producer/admin (#2969 )
219+ * Add OffsetSpec / IsolationLevel to kafka imports (#2898 )
220+ * Make IncompatibleBrokerVersion a subclass of UnsupportedVersionError (#2924 )
221+
52222Fixes
53223* Fix zstd multi-frame decompression failure (#2717 )
54224* Use time.monotonic() instead of time.time() for elapsed time calculations (#2714 )
225+ * Fix deprecated log.warn() -> log.warning()
226+ * REF: Switch to deque.copy() for Python 3 compatibility (#2712 )
227+
228+ Tests
229+ * MockBroker / MockTransport for deterministic protocol tests (#2861 , #2902 )
230+ * Organize test files into consumer/ producer/ admin/ directories (#2844 )
231+ * Consolidate consumer integration tests (#2857 )
232+ * Consolidate more pytest fixtures (admin/client) (#2921 )
233+ * Integration fixtures use contextmanager (#2966 )
234+ * Refactor coordinator test fixtures; prefer MockBroker to patched_coord (#2953 )
235+ * Support SSL transports in KafkaFixture (#2806 )
236+ * Simplify interacting with KafkaFixture (client factories, create_topics) (#2808 )
237+ * Use producer/consumer/admin factories in producer_integration tests (#2829 )
238+ * Set api_version for integration tests; fix test_group missing consumers (#2824 )
239+ * Close local fixtures in tests (#2962 )
240+ * Catch exceptions in fixture.open() -> close() (#2907 )
241+ * Create topic on 0.8.2 broker to fix bootstrap (#2896 )
242+ * Reduce timing flakiness in test_group (#3006 )
243+ * Test timeouts: use pytest-timeout method=thread and add faulthandler
55244
56245Project Infra
57246* Enable pylint workflow; disable/fix all outstanding errors (#2701 )
58247* Add coverage step to CI (#2786 )
59- * CI test matrix updated to Kafka 4.0-4.2
248+ * CI test matrix updated to Kafka 4.0-4.2 (#2836 )
249+ * Enable manual workflow runs for Python Package
250+ * Add lint-unicode make target; include in make lint test (#2993 )
251+ * pyproject updates: no more universal wheels; tested on py3.8+
252+ * Bump version to 3.0.0.dev
60253* Bump actions/cache from 4 to 5 (#2702 )
61254* Bump actions/upload-artifact from 4 to 7 (#2789 )
62255
0 commit comments