@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) 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
|
|
@@ -57,6 +58,10 @@ static struct {
|
|
|
57
58
|
|
|
58
59
|
} next;
|
|
59
60
|
int term;
|
|
61
|
+
/* Number of created sockets */
|
|
62
|
+
int num_sockets;
|
|
63
|
+
/* Current test, available to all threads as it's not TLS */
|
|
64
|
+
struct test *test_curr;
|
|
60
65
|
} ctrl;
|
|
61
66
|
|
|
62
67
|
static int ctrl_thrd_main(void *arg) {
|
|
@@ -67,6 +72,10 @@ static int ctrl_thrd_main(void *arg) {
|
|
|
67
72
|
int64_t now;
|
|
68
73
|
|
|
69
74
|
cnd_timedwait_ms(&ctrl.cnd, &ctrl.lock, 10);
|
|
75
|
+
if (!test_socket_find(ctrl.test_curr, ctrl.skm))
|
|
76
|
+
/* Socket was closed and destroyed when
|
|
77
|
+
* releasing the lock. */
|
|
78
|
+
break;
|
|
70
79
|
|
|
71
80
|
if (ctrl.cmd.ts_at) {
|
|
72
81
|
ctrl.next.ts_at = ctrl.cmd.ts_at;
|
|
@@ -106,8 +115,16 @@ static int ctrl_thrd_main(void *arg) {
|
|
|
106
115
|
static int connect_cb(struct test *test, sockem_t *skm, const char *id) {
|
|
107
116
|
|
|
108
117
|
mtx_lock(&ctrl.lock);
|
|
118
|
+
if (ctrl.num_sockets < 1) {
|
|
119
|
+
/* Since librdkafka is decommissioning brokers,
|
|
120
|
+
* first connection is with a bootstrap broker,
|
|
121
|
+
* next one is with a learned one. */
|
|
122
|
+
ctrl.num_sockets++;
|
|
123
|
+
mtx_unlock(&ctrl.lock);
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
109
126
|
if (ctrl.skm) {
|
|
110
|
-
/* Reject all but the first
|
|
127
|
+
/* Reject all but the first two connects */
|
|
111
128
|
mtx_unlock(&ctrl.lock);
|
|
112
129
|
return ECONNREFUSED;
|
|
113
130
|
}
|
|
@@ -170,14 +187,26 @@ static void do_test_low_socket_timeout(const char *topic) {
|
|
|
170
187
|
|
|
171
188
|
mtx_init(&ctrl.lock, mtx_plain);
|
|
172
189
|
cnd_init(&ctrl.cnd);
|
|
190
|
+
ctrl.test_curr = test_curr;
|
|
173
191
|
|
|
174
192
|
TEST_SAY("Test Metadata request retries on timeout\n");
|
|
175
193
|
|
|
194
|
+
test_create_topic_wait_exists(NULL, topic, 1, -1, 5000);
|
|
195
|
+
|
|
176
196
|
test_conf_init(&conf, NULL, 60);
|
|
177
197
|
test_conf_set(conf, "socket.timeout.ms", "1000");
|
|
178
198
|
test_conf_set(conf, "socket.max.fails", "12345");
|
|
179
199
|
test_conf_set(conf, "retry.backoff.ms", "5000");
|
|
180
200
|
test_conf_set(conf, "retry.backoff.max.ms", "5000");
|
|
201
|
+
/* Sparse re-connect interval depends on `reconnect.backoff.ms` / 2
|
|
202
|
+
* increasing it allows to saturate the sparse re-connect interval
|
|
203
|
+
* and avoid to concurrent connects: the first for setting the bootstrap
|
|
204
|
+
* brokers and the second for adding a new topic to get metadata for.
|
|
205
|
+
* This way the test is more reliable especially when using valgrind
|
|
206
|
+
* as it needs to keep the last connection only,
|
|
207
|
+
* to add a delay later. */
|
|
208
|
+
test_conf_set(conf, "reconnect.backoff.ms", "2000");
|
|
209
|
+
|
|
181
210
|
/* Avoid api version requests (with their own timeout) to get in
|
|
182
211
|
* the way of our test */
|
|
183
212
|
test_conf_set(conf, "api.version.request", "false");
|
|
@@ -244,6 +273,14 @@ static void do_test_low_socket_timeout(const char *topic) {
|
|
|
244
273
|
int main_0075_retry(int argc, char **argv) {
|
|
245
274
|
const char *topic = test_mk_topic_name("0075_retry", 1);
|
|
246
275
|
|
|
276
|
+
if (test_needs_auth()) {
|
|
277
|
+
/* When authentication is involved there's the need
|
|
278
|
+
* for additional SASL calls. These are delayed too and
|
|
279
|
+
* it changes test timing. */
|
|
280
|
+
TEST_SKIP("Cannot run this test with SSL/SASL\n");
|
|
281
|
+
return 0;
|
|
282
|
+
}
|
|
283
|
+
|
|
247
284
|
do_test_low_socket_timeout(topic);
|
|
248
285
|
|
|
249
286
|
return 0;
|
|
@@ -128,6 +128,7 @@ static void do_test_produce_retries(const char *topic,
|
|
|
128
128
|
|
|
129
129
|
rk = test_create_handle(RD_KAFKA_PRODUCER, conf);
|
|
130
130
|
rkt = test_create_producer_topic(rk, topic, NULL);
|
|
131
|
+
test_wait_topic_exists(rk, topic, 5000);
|
|
131
132
|
|
|
132
133
|
/* Create the topic to make sure connections are up and ready. */
|
|
133
134
|
err = test_auto_create_topic_rkt(rk, rkt, tmout_multip(5000));
|
|
@@ -277,6 +278,7 @@ static void do_test_produce_retries_disconnect(const char *topic,
|
|
|
277
278
|
|
|
278
279
|
rk = test_create_handle(RD_KAFKA_PRODUCER, conf);
|
|
279
280
|
rkt = test_create_producer_topic(rk, topic, NULL);
|
|
281
|
+
test_wait_topic_exists(rk, topic, 5000);
|
|
280
282
|
|
|
281
283
|
err = test_produce_sync(rk, rkt, testid, 0);
|
|
282
284
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* librdkafka - Apache Kafka C library
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2012-2022, Magnus Edenhill
|
|
5
|
+
* 2023, Confluent Inc.
|
|
5
6
|
* All rights reserved.
|
|
6
7
|
*
|
|
7
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -193,6 +194,7 @@ static void do_test_compaction(int msgs_per_key, const char *compression) {
|
|
|
193
194
|
"--config file.delete.delay.ms=10000 "
|
|
194
195
|
"--config max.compaction.lag.ms=100",
|
|
195
196
|
topic, partition + 1);
|
|
197
|
+
test_wait_topic_exists(NULL, topic, 5000);
|
|
196
198
|
|
|
197
199
|
test_conf_init(&conf, NULL, 120);
|
|
198
200
|
rd_kafka_conf_set_dr_msg_cb(conf, test_dr_msg_cb);
|
|
@@ -300,8 +302,12 @@ static void do_test_compaction(int msgs_per_key, const char *compression) {
|
|
|
300
302
|
* this doesn't really work because the low watermark offset
|
|
301
303
|
* is not updated on compaction if the first segment is not deleted.
|
|
302
304
|
* But it serves as a pause to let compaction kick in
|
|
303
|
-
* which is triggered by the dummy produce above.
|
|
304
|
-
|
|
305
|
+
* which is triggered by the dummy produce above.
|
|
306
|
+
* Compaction timer is every 15 seconds and
|
|
307
|
+
* with a large number of segments it can
|
|
308
|
+
* take the same time. */
|
|
309
|
+
wait_compaction(rk, topic, partition, 0,
|
|
310
|
+
msgcnt > 50 ? 30 * 1000 : 20 * 1000);
|
|
305
311
|
|
|
306
312
|
TEST_SAY(_C_YEL "Verify messages after compaction\n");
|
|
307
313
|
/* After compaction we expect the following messages:
|
|
@@ -528,22 +528,44 @@ static void do_test_ListConsumerGroups(const char *what,
|
|
|
528
528
|
q = useq ? useq : rd_kafka_queue_new(rk);
|
|
529
529
|
|
|
530
530
|
if (with_options) {
|
|
531
|
-
|
|
531
|
+
rd_kafka_error_t *error;
|
|
532
|
+
rd_kafka_consumer_group_state_t duplicate_states[2] = {
|
|
532
533
|
RD_KAFKA_CONSUMER_GROUP_STATE_EMPTY,
|
|
533
534
|
RD_KAFKA_CONSUMER_GROUP_STATE_EMPTY};
|
|
535
|
+
rd_kafka_consumer_group_type_t duplicate_types[2] = {
|
|
536
|
+
RD_KAFKA_CONSUMER_GROUP_TYPE_CLASSIC,
|
|
537
|
+
RD_KAFKA_CONSUMER_GROUP_TYPE_CLASSIC};
|
|
538
|
+
rd_kafka_consumer_group_type_t unknown_type[1] = {
|
|
539
|
+
RD_KAFKA_CONSUMER_GROUP_TYPE_UNKNOWN};
|
|
534
540
|
|
|
535
541
|
options = rd_kafka_AdminOptions_new(
|
|
536
542
|
rk, RD_KAFKA_ADMIN_OP_LISTCONSUMERGROUPS);
|
|
537
543
|
|
|
538
544
|
/* Test duplicate error on match states */
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
options, duplicate, 2);
|
|
545
|
+
error = rd_kafka_AdminOptions_set_match_consumer_group_states(
|
|
546
|
+
options, duplicate_states, 2);
|
|
542
547
|
TEST_ASSERT(error && rd_kafka_error_code(error), "%s",
|
|
543
548
|
"Expected error on duplicate states,"
|
|
544
549
|
" got no error");
|
|
545
550
|
rd_kafka_error_destroy(error);
|
|
546
551
|
|
|
552
|
+
/* Test duplicate error on match group types */
|
|
553
|
+
error = rd_kafka_AdminOptions_set_match_consumer_group_types(
|
|
554
|
+
options, duplicate_types, 2);
|
|
555
|
+
TEST_ASSERT(error && rd_kafka_error_code(error), "%s",
|
|
556
|
+
"Expected error on duplicate group types,"
|
|
557
|
+
" got no error");
|
|
558
|
+
rd_kafka_error_destroy(error);
|
|
559
|
+
|
|
560
|
+
/* Test invalid args error on setting UNKNOWN group type in
|
|
561
|
+
* match group types */
|
|
562
|
+
error = rd_kafka_AdminOptions_set_match_consumer_group_types(
|
|
563
|
+
options, unknown_type, 1);
|
|
564
|
+
TEST_ASSERT(error && rd_kafka_error_code(error), "%s",
|
|
565
|
+
"Expected error on Unknown group type,"
|
|
566
|
+
" got no error");
|
|
567
|
+
rd_kafka_error_destroy(error);
|
|
568
|
+
|
|
547
569
|
exp_timeout = MY_SOCKET_TIMEOUT_MS * 2;
|
|
548
570
|
TEST_CALL_ERR__(rd_kafka_AdminOptions_set_request_timeout(
|
|
549
571
|
options, exp_timeout, errstr, sizeof(errstr)));
|
|
@@ -2686,6 +2708,10 @@ static void do_test_unclean_destroy(rd_kafka_type_t cltype, int with_mainq) {
|
|
|
2686
2708
|
* rely on the controller not being found. */
|
|
2687
2709
|
test_conf_set(conf, "bootstrap.servers", "");
|
|
2688
2710
|
test_conf_set(conf, "socket.timeout.ms", "60000");
|
|
2711
|
+
if (test_consumer_group_protocol()) {
|
|
2712
|
+
test_conf_set(conf, "group.protocol",
|
|
2713
|
+
test_consumer_group_protocol());
|
|
2714
|
+
}
|
|
2689
2715
|
|
|
2690
2716
|
rk = rd_kafka_new(cltype, conf, errstr, sizeof(errstr));
|
|
2691
2717
|
TEST_ASSERT(rk, "kafka_new(%d): %s", cltype, errstr);
|
|
@@ -2893,6 +2919,10 @@ static rd_kafka_t *create_admin_client(rd_kafka_type_t cltype) {
|
|
|
2893
2919
|
* rely on the controller not being found. */
|
|
2894
2920
|
test_conf_set(conf, "bootstrap.servers", "");
|
|
2895
2921
|
test_conf_set(conf, "socket.timeout.ms", MY_SOCKET_TIMEOUT_MS_STR);
|
|
2922
|
+
if (test_consumer_group_protocol()) {
|
|
2923
|
+
test_conf_set(conf, "group.protocol",
|
|
2924
|
+
test_consumer_group_protocol());
|
|
2925
|
+
}
|
|
2896
2926
|
/* For use with the background queue */
|
|
2897
2927
|
rd_kafka_conf_set_background_event_cb(conf, background_event_cb);
|
|
2898
2928
|
|