@platformatic/rdkafka 4.0.1 → 4.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/bench/seed.sh +0 -0
- package/binding.gyp +8 -1
- package/ci/prepublish.js +4 -4
- package/config.d.ts +126 -10
- package/configure +0 -0
- package/deps/librdkafka/.semaphore/run-all-tests.yml +77 -0
- package/deps/librdkafka/.semaphore/semaphore-integration.yml +250 -0
- package/deps/librdkafka/.semaphore/semaphore.yml +67 -44
- package/deps/librdkafka/.semaphore/verify-linux-packages.yml +41 -0
- package/deps/librdkafka/CHANGELOG.md +471 -1
- package/deps/librdkafka/CONFIGURATION.md +29 -9
- package/deps/librdkafka/INTRODUCTION.md +909 -601
- package/deps/librdkafka/LICENSES.txt +592 -1
- package/deps/librdkafka/Makefile +2 -1
- package/deps/librdkafka/configure +0 -0
- package/deps/librdkafka/debian/rules +0 -0
- package/deps/librdkafka/dev-conf.sh +0 -0
- package/deps/librdkafka/examples/consumer.c +18 -8
- package/deps/librdkafka/examples/describe_consumer_groups.c +25 -6
- package/deps/librdkafka/examples/incremental_alter_configs.c +4 -5
- package/deps/librdkafka/examples/kafkatest_verifiable_client.cpp +26 -42
- package/deps/librdkafka/examples/openssl_engine_example.cpp +3 -4
- package/deps/librdkafka/examples/producer.cpp +2 -2
- package/deps/librdkafka/examples/user_scram.c +4 -5
- package/deps/librdkafka/examples/win_ssl_cert_store.cpp +4 -3
- package/deps/librdkafka/lds-gen.py +0 -0
- package/deps/librdkafka/mklove/Makefile.base +0 -0
- package/deps/librdkafka/packaging/RELEASE.md +8 -0
- package/deps/librdkafka/packaging/alpine/build-alpine.sh +0 -0
- package/deps/librdkafka/packaging/cp/README.md +4 -1
- package/deps/librdkafka/packaging/cp/check_features.c +12 -4
- package/deps/librdkafka/packaging/cp/verify-deb.sh +6 -6
- package/deps/librdkafka/packaging/cp/verify-packages.sh +52 -31
- package/deps/librdkafka/packaging/cp/verify-rpm.sh +6 -13
- package/deps/librdkafka/packaging/debian/rules +0 -0
- package/deps/librdkafka/packaging/get_version.py +0 -0
- package/deps/librdkafka/packaging/homebrew/brew-update-pr.sh +0 -0
- package/deps/librdkafka/packaging/mingw-w64/{travis-before-install.sh → export-variables.sh} +0 -7
- package/deps/librdkafka/packaging/mingw-w64/semaphoreci-build.sh +1 -1
- package/deps/librdkafka/packaging/nuget/artifact.py +0 -0
- package/deps/librdkafka/packaging/nuget/cleanup-s3.py +0 -0
- package/deps/librdkafka/packaging/nuget/nuget.sh +0 -0
- package/deps/librdkafka/packaging/nuget/packaging.py +0 -0
- package/deps/librdkafka/packaging/nuget/push-to-nuget.sh +0 -0
- package/deps/librdkafka/packaging/nuget/release.py +0 -0
- package/deps/librdkafka/packaging/nuget/requirements.txt +3 -3
- package/deps/librdkafka/packaging/rpm/mock-on-docker.sh +0 -0
- package/deps/librdkafka/packaging/rpm/tests/run-test.sh +0 -0
- package/deps/librdkafka/packaging/rpm/tests/test-on-docker.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-configurations-checks.sh +3 -1
- package/deps/librdkafka/packaging/tools/build-deb-package.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-debian.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-manylinux.sh +0 -0
- package/deps/librdkafka/packaging/tools/build-release-artifacts.sh +0 -0
- package/deps/librdkafka/packaging/tools/distro-build.sh +0 -0
- package/deps/librdkafka/packaging/tools/gh-release-checksums.py +0 -0
- package/deps/librdkafka/packaging/tools/rdutcoverage.sh +0 -0
- package/deps/librdkafka/packaging/tools/run-in-docker.sh +28 -0
- package/deps/librdkafka/packaging/tools/run-integration-tests.sh +31 -0
- package/deps/librdkafka/packaging/tools/run-style-check.sh +4 -0
- package/deps/librdkafka/packaging/tools/style-format.sh +6 -5
- package/deps/librdkafka/packaging/tools/update_rpcs_max_versions.py +100 -0
- package/deps/librdkafka/service.yml +154 -0
- package/deps/librdkafka/src/generate_proto.sh +0 -0
- package/deps/librdkafka/src/rd.h +145 -2
- package/deps/librdkafka/src/rdaddr.h +6 -7
- package/deps/librdkafka/src/rdatomic.h +15 -11
- package/deps/librdkafka/src/rdavg.h +3 -2
- package/deps/librdkafka/src/rdbase64.c +33 -2
- package/deps/librdkafka/src/rdbase64.h +2 -0
- package/deps/librdkafka/src/rdendian.h +10 -9
- package/deps/librdkafka/src/rdhttp.c +418 -100
- package/deps/librdkafka/src/rdhttp.h +23 -5
- package/deps/librdkafka/src/rdkafka.c +299 -145
- package/deps/librdkafka/src/rdkafka.h +89 -6
- package/deps/librdkafka/src/rdkafka_admin.c +482 -105
- package/deps/librdkafka/src/rdkafka_admin.h +42 -0
- package/deps/librdkafka/src/rdkafka_broker.c +463 -312
- package/deps/librdkafka/src/rdkafka_broker.h +68 -10
- package/deps/librdkafka/src/rdkafka_buf.c +8 -5
- package/deps/librdkafka/src/rdkafka_buf.h +4 -3
- package/deps/librdkafka/src/rdkafka_cert.c +25 -1
- package/deps/librdkafka/src/rdkafka_cert.h +4 -3
- package/deps/librdkafka/src/rdkafka_cgrp.c +468 -143
- package/deps/librdkafka/src/rdkafka_cgrp.h +36 -2
- package/deps/librdkafka/src/rdkafka_conf.c +526 -102
- package/deps/librdkafka/src/rdkafka_conf.h +68 -4
- package/deps/librdkafka/src/rdkafka_feature.c +472 -35
- package/deps/librdkafka/src/rdkafka_feature.h +2 -0
- package/deps/librdkafka/src/rdkafka_fetcher.c +22 -2
- package/deps/librdkafka/src/rdkafka_fetcher.h +2 -2
- package/deps/librdkafka/src/rdkafka_int.h +84 -46
- package/deps/librdkafka/src/rdkafka_metadata.c +221 -136
- package/deps/librdkafka/src/rdkafka_metadata.h +15 -11
- package/deps/librdkafka/src/rdkafka_metadata_cache.c +279 -73
- package/deps/librdkafka/src/rdkafka_mock.c +795 -19
- package/deps/librdkafka/src/rdkafka_mock.h +119 -0
- package/deps/librdkafka/src/rdkafka_mock_cgrp.c +1298 -132
- package/deps/librdkafka/src/rdkafka_mock_handlers.c +345 -49
- package/deps/librdkafka/src/rdkafka_mock_int.h +180 -61
- package/deps/librdkafka/src/rdkafka_msg.c +35 -19
- package/deps/librdkafka/src/rdkafka_msg.h +3 -3
- package/deps/librdkafka/src/rdkafka_msgset_writer.c +14 -10
- package/deps/librdkafka/src/rdkafka_offset.c +33 -5
- package/deps/librdkafka/src/rdkafka_op.c +1 -1
- package/deps/librdkafka/src/rdkafka_op.h +45 -21
- package/deps/librdkafka/src/rdkafka_partition.c +118 -23
- package/deps/librdkafka/src/rdkafka_partition.h +16 -7
- package/deps/librdkafka/src/rdkafka_proto.h +4 -1
- package/deps/librdkafka/src/rdkafka_protocol.h +1 -0
- package/deps/librdkafka/src/rdkafka_queue.c +125 -48
- package/deps/librdkafka/src/rdkafka_queue.h +19 -0
- package/deps/librdkafka/src/rdkafka_range_assignor.c +1 -1
- package/deps/librdkafka/src/rdkafka_request.c +336 -64
- package/deps/librdkafka/src/rdkafka_request.h +24 -1
- package/deps/librdkafka/src/rdkafka_sasl.c +5 -3
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.c +14 -10
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c +1166 -89
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.h +13 -3
- package/deps/librdkafka/src/rdkafka_sasl_plain.c +3 -3
- package/deps/librdkafka/src/rdkafka_sasl_scram.c +4 -3
- package/deps/librdkafka/src/rdkafka_ssl.c +306 -81
- package/deps/librdkafka/src/rdkafka_ssl.h +22 -0
- package/deps/librdkafka/src/rdkafka_sticky_assignor.c +4 -0
- package/deps/librdkafka/src/rdkafka_telemetry.c +80 -23
- package/deps/librdkafka/src/rdkafka_telemetry_encode.c +5 -1
- package/deps/librdkafka/src/rdkafka_telemetry_encode.h +20 -20
- package/deps/librdkafka/src/rdkafka_topic.c +220 -137
- package/deps/librdkafka/src/rdkafka_topic.h +14 -8
- package/deps/librdkafka/src/rdkafka_transport.c +59 -47
- package/deps/librdkafka/src/rdkafka_transport.h +5 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.c +6 -1
- package/deps/librdkafka/src/rdmap.c +6 -1
- package/deps/librdkafka/src/rdrand.c +11 -1
- package/deps/librdkafka/src/rdtime.h +48 -17
- package/deps/librdkafka/src/rdunittest.c +42 -25
- package/deps/librdkafka/src/rdunittest.h +2 -0
- package/deps/librdkafka/src/rdwin32.h +1 -1
- package/deps/librdkafka/src/regexp.c +47 -42
- package/deps/librdkafka/src/tinycthread_extra.c +45 -21
- package/deps/librdkafka/src/tinycthread_extra.h +7 -3
- package/deps/librdkafka/src-cpp/rdkafkacpp.h +28 -2
- package/deps/librdkafka/tests/0001-multiobj.c +4 -0
- package/deps/librdkafka/tests/0004-conf.c +103 -36
- package/deps/librdkafka/tests/0009-mock_cluster.c +1 -0
- package/deps/librdkafka/tests/0011-produce_batch.c +2 -1
- package/deps/librdkafka/tests/0016-client_swname.c +18 -3
- package/deps/librdkafka/tests/0017-compression.c +6 -8
- package/deps/librdkafka/tests/0018-cgrp_term.c +8 -3
- package/deps/librdkafka/tests/0021-rkt_destroy.c +1 -0
- package/deps/librdkafka/tests/0022-consume_batch.c +4 -1
- package/deps/librdkafka/tests/0026-consume_pause.c +12 -14
- package/deps/librdkafka/tests/0028-long_topicnames.c +1 -1
- package/deps/librdkafka/tests/0029-assign_offset.c +6 -8
- package/deps/librdkafka/tests/0030-offset_commit.c +2 -2
- package/deps/librdkafka/tests/0033-regex_subscribe.c +33 -17
- package/deps/librdkafka/tests/0034-offset_reset.c +25 -4
- package/deps/librdkafka/tests/0036-partial_fetch.c +1 -0
- package/deps/librdkafka/tests/0038-performance.c +1 -0
- package/deps/librdkafka/tests/0040-io_event.c +11 -5
- package/deps/librdkafka/tests/0041-fetch_max_bytes.c +1 -0
- package/deps/librdkafka/tests/0044-partition_cnt.c +3 -2
- package/deps/librdkafka/tests/0045-subscribe_update.c +284 -20
- package/deps/librdkafka/tests/0047-partial_buf_tmout.c +1 -0
- package/deps/librdkafka/tests/0048-partitioner.c +1 -1
- package/deps/librdkafka/tests/0050-subscribe_adds.c +1 -0
- package/deps/librdkafka/tests/0051-assign_adds.c +1 -0
- package/deps/librdkafka/tests/0052-msg_timestamps.c +22 -4
- package/deps/librdkafka/tests/0053-stats_cb.cpp +12 -20
- package/deps/librdkafka/tests/0055-producer_latency.c +176 -3
- package/deps/librdkafka/tests/0056-balanced_group_mt.c +6 -2
- package/deps/librdkafka/tests/0058-log.cpp +3 -3
- package/deps/librdkafka/tests/0059-bsearch.cpp +8 -4
- package/deps/librdkafka/tests/0061-consumer_lag.cpp +25 -5
- package/deps/librdkafka/tests/0067-empty_topic.cpp +3 -0
- package/deps/librdkafka/tests/0068-produce_timeout.c +21 -23
- package/deps/librdkafka/tests/0069-consumer_add_parts.c +3 -7
- package/deps/librdkafka/tests/0075-retry.c +38 -1
- package/deps/librdkafka/tests/0076-produce_retry.c +2 -0
- package/deps/librdkafka/tests/0077-compaction.c +8 -2
- package/deps/librdkafka/tests/0080-admin_ut.c +34 -4
- package/deps/librdkafka/tests/0081-admin.c +455 -155
- package/deps/librdkafka/tests/0082-fetch_max_bytes.cpp +4 -0
- package/deps/librdkafka/tests/0083-cb_event.c +8 -3
- package/deps/librdkafka/tests/0084-destroy_flags.c +14 -18
- package/deps/librdkafka/tests/0085-headers.cpp +4 -0
- package/deps/librdkafka/tests/0086-purge.c +40 -7
- package/deps/librdkafka/tests/0088-produce_metadata_timeout.c +1 -1
- package/deps/librdkafka/tests/0089-max_poll_interval.c +12 -7
- package/deps/librdkafka/tests/0090-idempotence.c +1 -2
- package/deps/librdkafka/tests/0091-max_poll_interval_timeout.c +5 -7
- package/deps/librdkafka/tests/0092-mixed_msgver.c +6 -0
- package/deps/librdkafka/tests/0093-holb.c +8 -5
- package/deps/librdkafka/tests/0094-idempotence_msg_timeout.c +1 -0
- package/deps/librdkafka/tests/0097-ssl_verify.cpp +262 -70
- package/deps/librdkafka/tests/0098-consumer-txn.cpp +16 -16
- package/deps/librdkafka/tests/0099-commit_metadata.c +1 -1
- package/deps/librdkafka/tests/0101-fetch-from-follower.cpp +1 -1
- package/deps/librdkafka/tests/0102-static_group_rebalance.c +317 -16
- package/deps/librdkafka/tests/0103-transactions.c +7 -7
- package/deps/librdkafka/tests/0104-fetch_from_follower_mock.c +1 -0
- package/deps/librdkafka/tests/0105-transactions_mock.c +18 -11
- package/deps/librdkafka/tests/0106-cgrp_sess_timeout.c +35 -14
- package/deps/librdkafka/tests/0107-topic_recreate.c +2 -2
- package/deps/librdkafka/tests/0109-auto_create_topics.cpp +86 -26
- package/deps/librdkafka/tests/0110-batch_size.cpp +1 -2
- package/deps/librdkafka/tests/0112-assign_unknown_part.c +3 -14
- package/deps/librdkafka/tests/0113-cooperative_rebalance.cpp +248 -104
- package/deps/librdkafka/tests/0114-sticky_partitioning.cpp +3 -3
- package/deps/librdkafka/tests/0115-producer_auth.cpp +4 -1
- package/deps/librdkafka/tests/0116-kafkaconsumer_close.cpp +7 -5
- package/deps/librdkafka/tests/0117-mock_errors.c +15 -5
- package/deps/librdkafka/tests/0118-commit_rebalance.c +41 -8
- package/deps/librdkafka/tests/0119-consumer_auth.cpp +20 -1
- package/deps/librdkafka/tests/0120-asymmetric_subscription.c +8 -3
- package/deps/librdkafka/tests/0125-immediate_flush.c +1 -1
- package/deps/librdkafka/tests/0126-oauthbearer_oidc.c +323 -8
- package/deps/librdkafka/tests/0129-fetch_aborted_msgs.c +1 -0
- package/deps/librdkafka/tests/0132-strategy_ordering.c +12 -4
- package/deps/librdkafka/tests/0133-ssl_keys.c +28 -6
- package/deps/librdkafka/tests/0137-barrier_batch_consume.c +24 -14
- package/deps/librdkafka/tests/0139-offset_validation_mock.c +510 -2
- package/deps/librdkafka/tests/0140-commit_metadata.cpp +1 -1
- package/deps/librdkafka/tests/0142-reauthentication.c +37 -17
- package/deps/librdkafka/tests/0143-exponential_backoff_mock.c +39 -40
- package/deps/librdkafka/tests/0146-metadata_mock.c +76 -15
- package/deps/librdkafka/tests/0147-consumer_group_consumer_mock.c +952 -0
- package/deps/librdkafka/tests/0148-offset_fetch_commit_error_mock.c +563 -0
- package/deps/librdkafka/tests/0149-broker-same-host-port.c +140 -0
- package/deps/librdkafka/tests/0150-telemetry_mock.c +9 -6
- package/deps/librdkafka/tests/0151-purge-brokers.c +566 -0
- package/deps/librdkafka/tests/0152-rebootstrap.c +59 -0
- package/deps/librdkafka/tests/0153-memberid.c +128 -0
- package/deps/librdkafka/tests/CMakeLists.txt +6 -0
- package/deps/librdkafka/tests/LibrdkafkaTestApp.py +34 -9
- package/deps/librdkafka/tests/autotest.sh +0 -0
- package/deps/librdkafka/tests/broker_version_tests.py +0 -0
- package/deps/librdkafka/tests/buildbox.sh +0 -0
- package/deps/librdkafka/tests/cleanup-checker-tests.sh +0 -0
- package/deps/librdkafka/tests/cluster_testing.py +0 -0
- package/deps/librdkafka/tests/delete-test-topics.sh +0 -0
- package/deps/librdkafka/tests/fixtures/oauthbearer/jwt_assertion_template.json +10 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.intermediate.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.intermediate.pem +72 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.pem +42 -101
- package/deps/librdkafka/tests/fixtures/ssl/client2.intermediate.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.key +41 -29
- package/deps/librdkafka/tests/fixtures/ssl/create_keys.sh +112 -37
- package/deps/librdkafka/tests/gen-ssl-certs.sh +0 -0
- package/deps/librdkafka/tests/interactive_broker_version.py +0 -0
- package/deps/librdkafka/tests/java/Makefile +2 -1
- package/deps/librdkafka/tests/java/run-class.sh +0 -0
- package/deps/librdkafka/tests/lz4_manual_test.sh +0 -0
- package/deps/librdkafka/tests/multi-broker-version-test.sh +0 -0
- package/deps/librdkafka/tests/parse-refcnt.sh +0 -0
- package/deps/librdkafka/tests/performance_plot.py +0 -0
- package/deps/librdkafka/tests/requirements.txt +1 -1
- package/deps/librdkafka/tests/run-all-tests.sh +79 -0
- package/deps/librdkafka/tests/run-consumer-tests.sh +0 -0
- package/deps/librdkafka/tests/run-producer-tests.sh +0 -0
- package/deps/librdkafka/tests/run-test-batches.py +157 -0
- package/deps/librdkafka/tests/run-test.sh +0 -0
- package/deps/librdkafka/tests/sasl_test.py +0 -0
- package/deps/librdkafka/tests/test.c +478 -18
- package/deps/librdkafka/tests/test.h +62 -13
- package/deps/librdkafka/tests/testcpp.cpp +6 -1
- package/deps/librdkafka/tests/testcpp.h +30 -2
- package/deps/librdkafka/tests/testshared.h +16 -2
- package/deps/librdkafka/tests/tools/stats/graph.py +0 -0
- package/deps/librdkafka/tests/tools/stats/to_csv.py +1 -1
- package/deps/librdkafka/tests/trivup/trivup-0.14.0.tar.gz +0 -0
- package/deps/librdkafka/tests/until-fail.sh +0 -0
- package/deps/librdkafka/tests/xxxx-metadata.cpp +1 -1
- package/deps/librdkafka/vcpkg.json +1 -1
- package/deps/librdkafka/win32/setup-msys2.ps1 +24 -8
- package/deps/librdkafka/win32/setup-vcpkg.ps1 +28 -6
- package/deps/librdkafka/win32/tests/tests.vcxproj +6 -0
- package/deps/librdkafka/win32/wingetopt.h +5 -4
- package/errors.d.ts +27 -1
- package/lib/error.js +29 -3
- package/make_docs.sh +0 -0
- package/package.json +10 -11
- package/run_docker.sh +0 -0
- package/src/callbacks.cc +6 -9
- package/src/callbacks.h +1 -5
- package/test/kafka-consumer-worker.js +10 -7
- package/test/kafka-consumer.spec.js +32 -21
- package/deps/librdkafka/.semaphore/project.yml +0 -43
- package/deps/librdkafka/.semaphore/project_public.yml +0 -20
- package/deps/librdkafka/win32/install-openssl.ps1 +0 -33
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* librdkafka - Apache Kafka C library
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2018-2022, Magnus Edenhill
|
|
5
|
+
* 2025, Confluent Inc.
|
|
5
6
|
* All rights reserved.
|
|
6
7
|
*
|
|
7
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -78,27 +79,41 @@ void cnd_wait_exit(cnd_t *cond) {
|
|
|
78
79
|
|
|
79
80
|
|
|
80
81
|
int cnd_timedwait_ms(cnd_t *cnd, mtx_t *mtx, int timeout_ms) {
|
|
81
|
-
|
|
82
|
+
int ret;
|
|
83
|
+
rd_ts_t abs_timeout;
|
|
84
|
+
rd_bool_t continue_timedwait = rd_true;
|
|
85
|
+
|
|
86
|
+
if (timeout_ms == RD_POLL_INFINITE)
|
|
82
87
|
return cnd_wait(cnd, mtx);
|
|
83
88
|
#if defined(_TTHREAD_WIN32_)
|
|
84
89
|
return _cnd_timedwait_win32(cnd, mtx, (DWORD)timeout_ms);
|
|
85
90
|
#else
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
ts.tv_nsec
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
abs_timeout = rd_timeout_init(timeout_ms);
|
|
92
|
+
do {
|
|
93
|
+
struct timeval tv;
|
|
94
|
+
struct timespec ts;
|
|
95
|
+
|
|
96
|
+
gettimeofday(&tv, NULL);
|
|
97
|
+
ts.tv_sec = tv.tv_sec;
|
|
98
|
+
ts.tv_nsec = tv.tv_usec * 1000;
|
|
99
|
+
|
|
100
|
+
ts.tv_sec += timeout_ms / 1000;
|
|
101
|
+
ts.tv_nsec += (timeout_ms % 1000) * 1000000;
|
|
102
|
+
|
|
103
|
+
if (ts.tv_nsec >= 1000000000) {
|
|
104
|
+
ts.tv_sec++;
|
|
105
|
+
ts.tv_nsec -= 1000000000;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
ret = cnd_timedwait(cnd, mtx, &ts);
|
|
109
|
+
continue_timedwait = ret == thrd_timedout;
|
|
110
|
+
if (continue_timedwait) {
|
|
111
|
+
timeout_ms = rd_timeout_remains(abs_timeout);
|
|
112
|
+
if (rd_timeout_expired(timeout_ms))
|
|
113
|
+
continue_timedwait = rd_false;
|
|
114
|
+
}
|
|
115
|
+
} while (continue_timedwait);
|
|
116
|
+
return ret;
|
|
102
117
|
#endif
|
|
103
118
|
}
|
|
104
119
|
|
|
@@ -113,13 +128,22 @@ int cnd_timedwait_msp(cnd_t *cnd, mtx_t *mtx, int *timeout_msp) {
|
|
|
113
128
|
return r;
|
|
114
129
|
}
|
|
115
130
|
|
|
116
|
-
int cnd_timedwait_abs(cnd_t *cnd, mtx_t *mtx,
|
|
117
|
-
|
|
131
|
+
int cnd_timedwait_abs(cnd_t *cnd, mtx_t *mtx, rd_ts_t abs_timeout) {
|
|
132
|
+
int r = thrd_timedout;
|
|
133
|
+
int timeout_ms;
|
|
134
|
+
if (abs_timeout == RD_POLL_INFINITE)
|
|
118
135
|
return cnd_wait(cnd, mtx);
|
|
119
|
-
else if (
|
|
136
|
+
else if (abs_timeout == RD_POLL_NOWAIT)
|
|
120
137
|
return thrd_timedout;
|
|
121
138
|
|
|
122
|
-
|
|
139
|
+
do {
|
|
140
|
+
timeout_ms = rd_timeout_remains(abs_timeout);
|
|
141
|
+
if (timeout_ms == RD_POLL_NOWAIT)
|
|
142
|
+
break;
|
|
143
|
+
r = cnd_timedwait_ms(cnd, mtx, timeout_ms);
|
|
144
|
+
} while (r == thrd_timedout);
|
|
145
|
+
|
|
146
|
+
return r;
|
|
123
147
|
}
|
|
124
148
|
|
|
125
149
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* librdkafka - Apache Kafka C library
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2018-2022, Magnus Edenhill
|
|
5
|
+
* 2025, Confluent Inc.
|
|
5
6
|
* All rights reserved.
|
|
6
7
|
*
|
|
7
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
#include <pthread.h> /* needed for rwlock_t */
|
|
41
42
|
#endif
|
|
42
43
|
|
|
44
|
+
#include "rdtypes.h"
|
|
43
45
|
|
|
44
46
|
/**
|
|
45
47
|
* @brief Set thread system name if platform supports it (pthreads)
|
|
@@ -83,13 +85,15 @@ int cnd_timedwait_ms(cnd_t *cnd, mtx_t *mtx, int timeout_ms);
|
|
|
83
85
|
int cnd_timedwait_msp(cnd_t *cnd, mtx_t *mtx, int *timeout_msp);
|
|
84
86
|
|
|
85
87
|
/**
|
|
86
|
-
* @brief Same as cnd_timedwait() but
|
|
88
|
+
* @brief Same as cnd_timedwait() but takes an ansolute timeout in microseconds.
|
|
89
|
+
* Honours
|
|
87
90
|
* RD_POLL_INFINITE (uses cnd_wait()),
|
|
88
91
|
* and RD_POLL_NOWAIT (return thrd_timedout immediately).
|
|
89
92
|
*
|
|
90
|
-
* @remark Set up \p
|
|
93
|
+
* @remark Set up \p abs_timeout with rd_timeout_init() or
|
|
94
|
+
* rd_timeout_init_us().
|
|
91
95
|
*/
|
|
92
|
-
int cnd_timedwait_abs(cnd_t *cnd, mtx_t *mtx,
|
|
96
|
+
int cnd_timedwait_abs(cnd_t *cnd, mtx_t *mtx, rd_ts_t abs_timeout);
|
|
93
97
|
|
|
94
98
|
|
|
95
99
|
|
|
@@ -112,7 +112,7 @@ namespace RdKafka {
|
|
|
112
112
|
* @remark This value should only be used during compile time,
|
|
113
113
|
* for runtime checks of version use RdKafka::version()
|
|
114
114
|
*/
|
|
115
|
-
#define RD_KAFKA_VERSION
|
|
115
|
+
#define RD_KAFKA_VERSION 0x020c00ff
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
118
|
* @brief Returns the librdkafka version as integer.
|
|
@@ -327,6 +327,11 @@ enum ErrorCode {
|
|
|
327
327
|
ERR__AUTO_OFFSET_RESET = -140,
|
|
328
328
|
/** Partition log truncation detected */
|
|
329
329
|
ERR__LOG_TRUNCATION = -139,
|
|
330
|
+
/** A different record in the batch was invalid
|
|
331
|
+
* and this message failed persisting. */
|
|
332
|
+
ERR__INVALID_DIFFERENT_RECORD = -138,
|
|
333
|
+
/** Broker is going away but client isn't terminating */
|
|
334
|
+
ERR__DESTROY_BROKER = -137,
|
|
330
335
|
|
|
331
336
|
/** End internal error codes */
|
|
332
337
|
ERR__END = -100,
|
|
@@ -544,7 +549,28 @@ enum ErrorCode {
|
|
|
544
549
|
/** Unable to update finalized features due to server error */
|
|
545
550
|
ERR_FEATURE_UPDATE_FAILED = 96,
|
|
546
551
|
/** Request principal deserialization failed during forwarding */
|
|
547
|
-
ERR_PRINCIPAL_DESERIALIZATION_FAILURE = 97
|
|
552
|
+
ERR_PRINCIPAL_DESERIALIZATION_FAILURE = 97,
|
|
553
|
+
/** Unknown Topic Id */
|
|
554
|
+
ERR_UNKNOWN_TOPIC_ID = 100,
|
|
555
|
+
/** The member epoch is fenced by the group coordinator */
|
|
556
|
+
ERR_FENCED_MEMBER_EPOCH = 110,
|
|
557
|
+
/** The instance ID is still used by another member in the
|
|
558
|
+
* consumer group */
|
|
559
|
+
ERR_UNRELEASED_INSTANCE_ID = 111,
|
|
560
|
+
/** The assignor or its version range is not supported by the consumer
|
|
561
|
+
* group */
|
|
562
|
+
ERR_UNSUPPORTED_ASSIGNOR = 112,
|
|
563
|
+
/** The member epoch is stale */
|
|
564
|
+
ERR_STALE_MEMBER_EPOCH = 113,
|
|
565
|
+
/** Client sent a push telemetry request with an invalid or outdated
|
|
566
|
+
* subscription ID. */
|
|
567
|
+
ERR_UNKNOWN_SUBSCRIPTION_ID = 117,
|
|
568
|
+
/** Client sent a push telemetry request larger than the maximum size
|
|
569
|
+
* the broker will accept. */
|
|
570
|
+
ERR_TELEMETRY_TOO_LARGE = 118,
|
|
571
|
+
/** Client metadata is stale,
|
|
572
|
+
* client should rebootstrap to obtain new metadata. */
|
|
573
|
+
ERR_REBOOTSTRAP_REQUIRED = 129
|
|
548
574
|
};
|
|
549
575
|
|
|
550
576
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* librdkafka - Apache Kafka C library
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2012-2022, Magnus Edenhill
|
|
5
|
+
* 2025, Confluent Inc.
|
|
5
6
|
* All rights reserved.
|
|
6
7
|
*
|
|
7
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -92,6 +93,9 @@ int main_0001_multiobj(int argc, char **argv) {
|
|
|
92
93
|
/* Topic is created on the first iteration. */
|
|
93
94
|
if (i > 0)
|
|
94
95
|
TIMING_ASSERT(&t_full, 0, 999);
|
|
96
|
+
else
|
|
97
|
+
/* Allow metadata propagation. */
|
|
98
|
+
rd_sleep(1);
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
return 0;
|
|
@@ -511,28 +511,27 @@ int main_0004_conf(int argc, char **argv) {
|
|
|
511
511
|
int i;
|
|
512
512
|
const char *topic;
|
|
513
513
|
static const char *gconfs[] = {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
514
|
+
"message.max.bytes",
|
|
515
|
+
"12345", /* int property */
|
|
516
|
+
"client.id",
|
|
517
|
+
"my id", /* string property */
|
|
518
|
+
"debug",
|
|
519
|
+
"topic,metadata,interceptor", /* S2F property */
|
|
520
|
+
"topic.blacklist",
|
|
521
|
+
"__.*", /* #778 */
|
|
522
|
+
"auto.offset.reset",
|
|
523
|
+
"earliest", /* Global->Topic fallthru */
|
|
524
524
|
#if WITH_ZLIB
|
|
525
|
-
|
|
526
|
-
|
|
525
|
+
"compression.codec",
|
|
526
|
+
"gzip", /* S2I property */
|
|
527
527
|
#endif
|
|
528
528
|
#if defined(_WIN32)
|
|
529
|
-
|
|
530
|
-
|
|
529
|
+
"ssl.ca.certificate.stores",
|
|
530
|
+
"Intermediate ,, Root ,",
|
|
531
531
|
#endif
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
};
|
|
532
|
+
"client.dns.lookup",
|
|
533
|
+
"resolve_canonical_bootstrap_servers_only",
|
|
534
|
+
NULL};
|
|
536
535
|
static const char *tconfs[] = {"request.required.acks",
|
|
537
536
|
"-1", /* int */
|
|
538
537
|
"auto.commit.enable",
|
|
@@ -721,6 +720,75 @@ int main_0004_conf(int argc, char **argv) {
|
|
|
721
720
|
rd_kafka_conf_destroy(conf);
|
|
722
721
|
}
|
|
723
722
|
|
|
723
|
+
#if WITH_OAUTHBEARER_OIDC
|
|
724
|
+
{
|
|
725
|
+
TEST_SAY(
|
|
726
|
+
"Verify that https.ca.location is mutually "
|
|
727
|
+
"exclusive with https.ca.pem\n");
|
|
728
|
+
|
|
729
|
+
conf = rd_kafka_conf_new();
|
|
730
|
+
|
|
731
|
+
test_conf_set(conf, "https.ca.pem",
|
|
732
|
+
"-----BEGIN CERTIFICATE-----");
|
|
733
|
+
test_conf_set(conf, "https.ca.location",
|
|
734
|
+
"/path/to/certificate.pem");
|
|
735
|
+
|
|
736
|
+
rk = rd_kafka_new(RD_KAFKA_PRODUCER, conf, errstr,
|
|
737
|
+
sizeof(errstr));
|
|
738
|
+
TEST_ASSERT(
|
|
739
|
+
!rk, "Expected rd_kafka_new() to fail, but it succeeded");
|
|
740
|
+
TEST_ASSERT(!strcmp(errstr,
|
|
741
|
+
"`https.ca.location` and "
|
|
742
|
+
"`https.ca.pem` are mutually exclusive"),
|
|
743
|
+
"Expected rd_kafka_new() to fail with: "
|
|
744
|
+
"\"`https.ca.location` and `https.ca.pem` "
|
|
745
|
+
"are mutually exclusive\", got: \"%s\"",
|
|
746
|
+
errstr);
|
|
747
|
+
rd_kafka_conf_destroy(conf);
|
|
748
|
+
}
|
|
749
|
+
{
|
|
750
|
+
TEST_SAY(
|
|
751
|
+
"Verify that https.ca.location gives an error when "
|
|
752
|
+
"set to an invalid path\n");
|
|
753
|
+
|
|
754
|
+
conf = rd_kafka_conf_new();
|
|
755
|
+
|
|
756
|
+
test_conf_set(conf, "https.ca.location",
|
|
757
|
+
"/?/does/!/not/exist!");
|
|
758
|
+
|
|
759
|
+
rk = rd_kafka_new(RD_KAFKA_PRODUCER, conf, errstr,
|
|
760
|
+
sizeof(errstr));
|
|
761
|
+
TEST_ASSERT(
|
|
762
|
+
!rk, "Expected rd_kafka_new() to fail, but it succeeded");
|
|
763
|
+
TEST_ASSERT(!strcmp(errstr,
|
|
764
|
+
"`https.ca.location` must be "
|
|
765
|
+
"an existing file or directory"),
|
|
766
|
+
"Expected rd_kafka_new() to fail with: "
|
|
767
|
+
"\"`https.ca.location` must be "
|
|
768
|
+
"an existing file or directory\", got: \"%s\"",
|
|
769
|
+
errstr);
|
|
770
|
+
rd_kafka_conf_destroy(conf);
|
|
771
|
+
}
|
|
772
|
+
{
|
|
773
|
+
TEST_SAY(
|
|
774
|
+
"Verify that https.ca.location doesn't give an error when "
|
|
775
|
+
"set to `probe`\n");
|
|
776
|
+
|
|
777
|
+
conf = rd_kafka_conf_new();
|
|
778
|
+
|
|
779
|
+
test_conf_set(conf, "https.ca.location", "probe");
|
|
780
|
+
|
|
781
|
+
rk = rd_kafka_new(RD_KAFKA_PRODUCER, conf, errstr,
|
|
782
|
+
sizeof(errstr));
|
|
783
|
+
TEST_ASSERT(
|
|
784
|
+
rk, "Expected rd_kafka_new() not to fail, but it failed");
|
|
785
|
+
|
|
786
|
+
rd_kafka_destroy(rk);
|
|
787
|
+
}
|
|
788
|
+
#endif /* WITH_OAUTHBEARER_OIDC */
|
|
789
|
+
|
|
790
|
+
/* Verify that OpenSSL_AppLink is not needed on Windows (#3554) */
|
|
791
|
+
|
|
724
792
|
#ifdef _WIN32
|
|
725
793
|
{
|
|
726
794
|
FILE *fp;
|
|
@@ -774,26 +842,25 @@ int main_0004_conf(int argc, char **argv) {
|
|
|
774
842
|
const char *exp;
|
|
775
843
|
int is_global;
|
|
776
844
|
} props[] = {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
845
|
+
{"request.required.acks", "0", "0"},
|
|
846
|
+
{"request.required.acks", "-1", "-1"},
|
|
847
|
+
{"request.required.acks", "1", "1"},
|
|
848
|
+
{"acks", "3", "3"}, /* alias test */
|
|
849
|
+
{"request.required.acks", "393", "393"},
|
|
850
|
+
{"request.required.acks", "bad", NULL},
|
|
851
|
+
{"request.required.acks", "all", "-1"},
|
|
852
|
+
{"request.required.acks", "all", "-1", 1 /*fallthru*/},
|
|
853
|
+
{"acks", "0", "0"}, /* alias test */
|
|
786
854
|
#if WITH_SASL
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
855
|
+
{"sasl.mechanisms", "GSSAPI", "GSSAPI", 1},
|
|
856
|
+
{"sasl.mechanisms", "PLAIN", "PLAIN", 1},
|
|
857
|
+
{"sasl.mechanisms", "GSSAPI,PLAIN", NULL, 1},
|
|
858
|
+
{"sasl.mechanisms", "", NULL, 1},
|
|
791
859
|
#endif
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
};
|
|
860
|
+
{"linger.ms", "12555.3", "12555.3", 1},
|
|
861
|
+
{"linger.ms", "1500.000", "1500", 1},
|
|
862
|
+
{"linger.ms", "0.0001", "0.0001", 1},
|
|
863
|
+
{NULL}};
|
|
797
864
|
|
|
798
865
|
TEST_SAY("Canonical tests\n");
|
|
799
866
|
tconf = rd_kafka_topic_conf_new();
|
|
@@ -64,6 +64,7 @@ int main_0009_mock_cluster(int argc, char **argv) {
|
|
|
64
64
|
c = test_create_consumer(topic, NULL, conf, NULL);
|
|
65
65
|
|
|
66
66
|
rkt = test_create_producer_topic(p, topic, NULL);
|
|
67
|
+
test_wait_topic_exists(p, topic, 5000);
|
|
67
68
|
|
|
68
69
|
/* Produce */
|
|
69
70
|
test_produce_msgs(p, rkt, 0, RD_KAFKA_PARTITION_UA, 0, msgcnt, NULL, 0);
|
|
@@ -366,7 +366,8 @@ static void test_per_message_partition_flag(void) {
|
|
|
366
366
|
TEST_SAY("test_per_message_partition_flag: Created kafka instance %s\n",
|
|
367
367
|
rd_kafka_name(rk));
|
|
368
368
|
topic_name = test_mk_topic_name("0011_per_message_flag", 1);
|
|
369
|
-
|
|
369
|
+
test_create_topic_wait_exists(rk, topic_name, topic_num_partitions, 1,
|
|
370
|
+
5000);
|
|
370
371
|
|
|
371
372
|
rkt = rd_kafka_topic_new(rk, topic_name, topic_conf);
|
|
372
373
|
if (!rkt)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* librdkafka - Apache Kafka C library
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2020-2022, Magnus Edenhill
|
|
5
|
+
* 2025, Confluent Inc.
|
|
5
6
|
* All rights reserved.
|
|
6
7
|
*
|
|
7
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -120,6 +121,11 @@ int main_0016_client_swname(int argc, char **argv) {
|
|
|
120
121
|
const char *jmx_port;
|
|
121
122
|
const char *reason = NULL;
|
|
122
123
|
|
|
124
|
+
if (test_needs_auth()) {
|
|
125
|
+
TEST_SKIP("Cannot run this test with SSL/SASL\n");
|
|
126
|
+
return 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
123
129
|
/* If available, use the Kafka JmxTool to query software name
|
|
124
130
|
* in broker JMX metrics */
|
|
125
131
|
if (!(broker = test_getenv("BROKER_ADDRESS_2", NULL)))
|
|
@@ -136,14 +142,23 @@ int main_0016_client_swname(int argc, char **argv) {
|
|
|
136
142
|
reason =
|
|
137
143
|
"Env var BROKER_JMX_PORT_2 missing "
|
|
138
144
|
"(not running in trivup or trivup too old?)";
|
|
139
|
-
else
|
|
145
|
+
else {
|
|
146
|
+
rd_bool_t apache_kafka_4 =
|
|
147
|
+
test_broker_version >= TEST_BRKVER(4, 0, 0, 0);
|
|
140
148
|
rd_snprintf(jmx_cmd, sizeof(jmx_cmd),
|
|
141
|
-
"%s/bin/kafka-run-class.sh
|
|
149
|
+
"%s/bin/kafka-run-class.sh %s "
|
|
142
150
|
"--jmx-url "
|
|
143
151
|
"service:jmx:rmi:///jndi/rmi://:%s/jmxrmi "
|
|
152
|
+
" --object-name '*:"
|
|
153
|
+
"clientSoftwareName=*,"
|
|
154
|
+
"clientSoftwareVersion=*,*' "
|
|
144
155
|
" --one-time true | "
|
|
145
156
|
"grep clientSoftware",
|
|
146
|
-
kafka_path,
|
|
157
|
+
kafka_path,
|
|
158
|
+
apache_kafka_4 ? "org.apache.kafka.tools.JmxTool"
|
|
159
|
+
: "kafka.tools.JmxTool",
|
|
160
|
+
jmx_port);
|
|
161
|
+
}
|
|
147
162
|
|
|
148
163
|
if (reason)
|
|
149
164
|
TEST_WARN("Will not be able to verify JMX metrics: %s\n",
|
|
@@ -44,20 +44,17 @@ int main_0017_compression(int argc, char **argv) {
|
|
|
44
44
|
int msg_base = 0;
|
|
45
45
|
uint64_t testid;
|
|
46
46
|
#define CODEC_CNT 5
|
|
47
|
-
const char *codecs[CODEC_CNT + 1] = {
|
|
48
|
-
"none",
|
|
47
|
+
const char *codecs[CODEC_CNT + 1] = {"none",
|
|
49
48
|
#if WITH_ZLIB
|
|
50
|
-
|
|
49
|
+
"gzip",
|
|
51
50
|
#endif
|
|
52
51
|
#if WITH_SNAPPY
|
|
53
|
-
|
|
52
|
+
"snappy",
|
|
54
53
|
#endif
|
|
55
54
|
#if WITH_ZSTD
|
|
56
|
-
|
|
55
|
+
"zstd",
|
|
57
56
|
#endif
|
|
58
|
-
|
|
59
|
-
NULL
|
|
60
|
-
};
|
|
57
|
+
"lz4", NULL};
|
|
61
58
|
char *topics[CODEC_CNT];
|
|
62
59
|
const int32_t partition = 0;
|
|
63
60
|
int i;
|
|
@@ -77,6 +74,7 @@ int main_0017_compression(int argc, char **argv) {
|
|
|
77
74
|
msg_cnt, codecs[i], topics[i]);
|
|
78
75
|
rkt_p = test_create_producer_topic(
|
|
79
76
|
rk_p, topics[i], "compression.codec", codecs[i], NULL);
|
|
77
|
+
test_wait_topic_exists(rk_p, topics[i], 5000);
|
|
80
78
|
|
|
81
79
|
/* Produce small message that will not decrease with
|
|
82
80
|
* compression (issue #781) */
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* librdkafka - Apache Kafka C library
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2012-2022, Magnus Edenhill
|
|
5
|
+
* 2025, Confluent Inc.
|
|
5
6
|
* All rights reserved.
|
|
6
7
|
*
|
|
7
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -63,14 +64,16 @@ static void rebalance_cb(rd_kafka_t *rk,
|
|
|
63
64
|
switch (err) {
|
|
64
65
|
case RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS:
|
|
65
66
|
assign_cnt++;
|
|
66
|
-
|
|
67
|
+
test_consumer_assign_by_rebalance_protocol("rebalance", rk,
|
|
68
|
+
partitions);
|
|
67
69
|
break;
|
|
68
70
|
|
|
69
71
|
case RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS:
|
|
70
72
|
if (assign_cnt == 0)
|
|
71
73
|
TEST_FAIL("asymetric rebalance_cb\n");
|
|
72
74
|
assign_cnt--;
|
|
73
|
-
|
|
75
|
+
test_consumer_unassign_by_rebalance_protocol("rebalance", rk,
|
|
76
|
+
partitions);
|
|
74
77
|
break;
|
|
75
78
|
|
|
76
79
|
default:
|
|
@@ -195,6 +198,7 @@ static void do_test(rd_bool_t with_queue) {
|
|
|
195
198
|
/* Produce messages */
|
|
196
199
|
rk_p = test_create_producer();
|
|
197
200
|
rkt_p = test_create_producer_topic(rk_p, topic, NULL);
|
|
201
|
+
test_wait_topic_exists(rk_p, topic, 5000);
|
|
198
202
|
|
|
199
203
|
for (partition = 0; partition < partition_cnt; partition++) {
|
|
200
204
|
test_produce_msgs(rk_p, rkt_p, testid, partition,
|
|
@@ -260,7 +264,8 @@ static void do_test(rd_bool_t with_queue) {
|
|
|
260
264
|
/* Let remaining consumers run for a while to take over the now
|
|
261
265
|
* lost partitions. */
|
|
262
266
|
|
|
263
|
-
|
|
267
|
+
/* Callback count can vary in KIP-848 */
|
|
268
|
+
if (test_consumer_group_protocol_classic() &&
|
|
264
269
|
assign_cnt != _CONS_CNT - 1)
|
|
265
270
|
TEST_FAIL("assign_cnt %d, should be %d\n", assign_cnt,
|
|
266
271
|
_CONS_CNT - 1);
|
|
@@ -56,6 +56,7 @@ int main_0021_rkt_destroy(int argc, char **argv) {
|
|
|
56
56
|
testid = test_id_generate();
|
|
57
57
|
rk = test_create_producer();
|
|
58
58
|
rkt = test_create_producer_topic(rk, topic, NULL);
|
|
59
|
+
test_wait_topic_exists(rk, topic, 5000);
|
|
59
60
|
|
|
60
61
|
|
|
61
62
|
test_produce_msgs_nowait(rk, rkt, testid, RD_KAFKA_PARTITION_UA, 0,
|
|
@@ -259,7 +259,10 @@ static void do_test_consume_batch_non_existent_topic(void) {
|
|
|
259
259
|
|
|
260
260
|
int main_0022_consume_batch(int argc, char **argv) {
|
|
261
261
|
do_test_consume_batch();
|
|
262
|
-
|
|
262
|
+
/* Subscribing to a non-existent topic doesn't generate a
|
|
263
|
+
* UNKNOWN_TOPIC_OR_PART error with `consumer` group rebalance protocol.
|
|
264
|
+
*/
|
|
265
|
+
if (test_consumer_group_protocol_classic()) {
|
|
263
266
|
do_test_consume_batch_non_existent_topic();
|
|
264
267
|
}
|
|
265
268
|
return 0;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* librdkafka - Apache Kafka C library
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2012-2022, Magnus Edenhill
|
|
5
|
+
* 2025, Confluent Inc.
|
|
5
6
|
* All rights reserved.
|
|
6
7
|
*
|
|
7
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -62,9 +63,7 @@ static void consume_pause(void) {
|
|
|
62
63
|
test_conf_set(conf, "enable.partition.eof", "true");
|
|
63
64
|
test_topic_conf_set(tconf, "auto.offset.reset", "smallest");
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
test_wait_topic_exists(NULL, topic, 10 * 1000);
|
|
66
|
+
test_create_topic_wait_exists(NULL, topic, partition_cnt, 1, 10 * 1000);
|
|
68
67
|
|
|
69
68
|
/* Produce messages */
|
|
70
69
|
testid =
|
|
@@ -260,9 +259,8 @@ static void consume_pause_resume_after_reassign(void) {
|
|
|
260
259
|
|
|
261
260
|
test_conf_init(&conf, NULL, 60);
|
|
262
261
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
test_wait_topic_exists(NULL, topic, 10 * 1000);
|
|
262
|
+
test_create_topic_wait_exists(NULL, topic, (int)partition + 1, 1,
|
|
263
|
+
10 * 1000);
|
|
266
264
|
|
|
267
265
|
/* Produce messages */
|
|
268
266
|
testid = test_produce_msgs_easy(topic, 0, partition, msgcnt);
|
|
@@ -380,7 +378,8 @@ static void rebalance_cb(rd_kafka_t *rk,
|
|
|
380
378
|
* while auto.offset.reset is default at `latest`. */
|
|
381
379
|
|
|
382
380
|
parts->elems[0].offset = RD_KAFKA_OFFSET_BEGINNING;
|
|
383
|
-
|
|
381
|
+
test_consumer_assign_by_rebalance_protocol("rebalance", rk,
|
|
382
|
+
parts);
|
|
384
383
|
TEST_SAY("Pausing partitions\n");
|
|
385
384
|
if ((err2 = rd_kafka_pause_partitions(rk, parts)))
|
|
386
385
|
TEST_FAIL("Failed to pause: %s",
|
|
@@ -391,7 +390,8 @@ static void rebalance_cb(rd_kafka_t *rk,
|
|
|
391
390
|
rd_kafka_err2str(err2));
|
|
392
391
|
break;
|
|
393
392
|
default:
|
|
394
|
-
|
|
393
|
+
test_consumer_unassign_by_rebalance_protocol("rebalance", rk,
|
|
394
|
+
parts);
|
|
395
395
|
break;
|
|
396
396
|
}
|
|
397
397
|
}
|
|
@@ -419,9 +419,8 @@ static void consume_subscribe_assign_pause_resume(void) {
|
|
|
419
419
|
|
|
420
420
|
test_conf_init(&conf, NULL, 20);
|
|
421
421
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
test_wait_topic_exists(NULL, topic, 10 * 1000);
|
|
422
|
+
test_create_topic_wait_exists(NULL, topic, (int)partition + 1, 1,
|
|
423
|
+
10 * 1000);
|
|
425
424
|
|
|
426
425
|
/* Produce messages */
|
|
427
426
|
testid = test_produce_msgs_easy(topic, 0, partition, msgcnt);
|
|
@@ -472,9 +471,8 @@ static void consume_seek_pause_resume(void) {
|
|
|
472
471
|
|
|
473
472
|
test_conf_init(&conf, NULL, 20);
|
|
474
473
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
test_wait_topic_exists(NULL, topic, 10 * 1000);
|
|
474
|
+
test_create_topic_wait_exists(NULL, topic, (int)partition + 1, 1,
|
|
475
|
+
10 * 1000);
|
|
478
476
|
|
|
479
477
|
/* Produce messages */
|
|
480
478
|
testid = test_produce_msgs_easy(topic, 0, partition, msgcnt);
|
|
@@ -62,7 +62,7 @@ int main_0028_long_topicnames(int argc, char **argv) {
|
|
|
62
62
|
rk_c = test_create_consumer(topic, NULL, NULL, NULL);
|
|
63
63
|
|
|
64
64
|
/* Create topic */
|
|
65
|
-
|
|
65
|
+
test_create_topic_wait_exists(rk_c, topic, 1, 1, 5000);
|
|
66
66
|
|
|
67
67
|
test_consumer_subscribe(rk_c, topic);
|
|
68
68
|
test_consumer_poll_no_msgs("consume.nomsgs", rk_c, 0, 5000);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* librdkafka - Apache Kafka C library
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2012-2022, Magnus Edenhill
|
|
5
|
+
* 2025, Confluent Inc.
|
|
5
6
|
* All rights reserved.
|
|
6
7
|
*
|
|
7
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -89,11 +90,13 @@ static void rebalance_cb(rd_kafka_t *rk,
|
|
|
89
90
|
}
|
|
90
91
|
TEST_SAY("Use these offsets:\n");
|
|
91
92
|
test_print_partition_list(parts);
|
|
92
|
-
|
|
93
|
+
test_consumer_assign_by_rebalance_protocol("HL.REBALANCE", rk,
|
|
94
|
+
parts);
|
|
93
95
|
break;
|
|
94
96
|
|
|
95
97
|
case RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS:
|
|
96
|
-
|
|
98
|
+
test_consumer_unassign_by_rebalance_protocol("HL.REBALANCE", rk,
|
|
99
|
+
parts);
|
|
97
100
|
break;
|
|
98
101
|
|
|
99
102
|
default:
|
|
@@ -111,12 +114,6 @@ int main_0029_assign_offset(int argc, char **argv) {
|
|
|
111
114
|
test_timing_t t_simple, t_hl;
|
|
112
115
|
test_msgver_t mv;
|
|
113
116
|
|
|
114
|
-
if (!test_consumer_group_protocol_generic()) {
|
|
115
|
-
/* FIXME: this should be fixed when upgrading from generic to
|
|
116
|
-
* new consumer group will be possible. See KAFKA-15989 */
|
|
117
|
-
return 0;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
117
|
test_conf_init(NULL, NULL, 20 + (test_session_timeout_ms * 3 / 1000));
|
|
121
118
|
|
|
122
119
|
/* Produce X messages to Y partitions so we get a
|
|
@@ -125,6 +122,7 @@ int main_0029_assign_offset(int argc, char **argv) {
|
|
|
125
122
|
testid = test_id_generate();
|
|
126
123
|
rk = test_create_producer();
|
|
127
124
|
rkt = test_create_producer_topic(rk, topic, NULL);
|
|
125
|
+
test_wait_topic_exists(rk, topic, 5000);
|
|
128
126
|
|
|
129
127
|
parts = rd_kafka_topic_partition_list_new(partitions);
|
|
130
128
|
|