@point3/node-rdkafka 3.6.0-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/LICENSE.txt +20 -0
- package/README.md +636 -0
- package/binding.gyp +154 -0
- package/deps/librdkafka/.clang-format +136 -0
- package/deps/librdkafka/.clang-format-cpp +103 -0
- package/deps/librdkafka/.dir-locals.el +10 -0
- package/deps/librdkafka/.formatignore +33 -0
- package/deps/librdkafka/.gdbmacros +19 -0
- package/deps/librdkafka/.github/CODEOWNERS +1 -0
- package/deps/librdkafka/.github/ISSUE_TEMPLATE +34 -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 +378 -0
- package/deps/librdkafka/.semaphore/verify-linux-packages.yml +41 -0
- package/deps/librdkafka/CHANGELOG.md +2208 -0
- package/deps/librdkafka/CMakeLists.txt +291 -0
- package/deps/librdkafka/CODE_OF_CONDUCT.md +46 -0
- package/deps/librdkafka/CONFIGURATION.md +209 -0
- package/deps/librdkafka/CONTRIBUTING.md +431 -0
- package/deps/librdkafka/Doxyfile +2375 -0
- package/deps/librdkafka/INTRODUCTION.md +2481 -0
- package/deps/librdkafka/LICENSE +26 -0
- package/deps/librdkafka/LICENSE.cjson +22 -0
- package/deps/librdkafka/LICENSE.crc32c +28 -0
- package/deps/librdkafka/LICENSE.fnv1a +18 -0
- package/deps/librdkafka/LICENSE.hdrhistogram +27 -0
- package/deps/librdkafka/LICENSE.lz4 +26 -0
- package/deps/librdkafka/LICENSE.murmur2 +25 -0
- package/deps/librdkafka/LICENSE.nanopb +22 -0
- package/deps/librdkafka/LICENSE.opentelemetry +203 -0
- package/deps/librdkafka/LICENSE.pycrc +23 -0
- package/deps/librdkafka/LICENSE.queue +31 -0
- package/deps/librdkafka/LICENSE.regexp +5 -0
- package/deps/librdkafka/LICENSE.snappy +36 -0
- package/deps/librdkafka/LICENSE.tinycthread +26 -0
- package/deps/librdkafka/LICENSE.wingetopt +49 -0
- package/deps/librdkafka/LICENSES.txt +625 -0
- package/deps/librdkafka/Makefile +125 -0
- package/deps/librdkafka/README.md +199 -0
- package/deps/librdkafka/README.win32 +26 -0
- package/deps/librdkafka/STATISTICS.md +624 -0
- package/deps/librdkafka/configure +214 -0
- package/deps/librdkafka/configure.self +331 -0
- package/deps/librdkafka/debian/changelog +111 -0
- package/deps/librdkafka/debian/compat +1 -0
- package/deps/librdkafka/debian/control +71 -0
- package/deps/librdkafka/debian/copyright +99 -0
- package/deps/librdkafka/debian/gbp.conf +9 -0
- package/deps/librdkafka/debian/librdkafka++1.install +1 -0
- package/deps/librdkafka/debian/librdkafka-dev.examples +2 -0
- package/deps/librdkafka/debian/librdkafka-dev.install +9 -0
- package/deps/librdkafka/debian/librdkafka1.docs +5 -0
- package/deps/librdkafka/debian/librdkafka1.install +1 -0
- package/deps/librdkafka/debian/librdkafka1.symbols +135 -0
- package/deps/librdkafka/debian/rules +19 -0
- package/deps/librdkafka/debian/source/format +1 -0
- package/deps/librdkafka/debian/watch +2 -0
- package/deps/librdkafka/dev-conf.sh +123 -0
- package/deps/librdkafka/examples/CMakeLists.txt +79 -0
- package/deps/librdkafka/examples/Makefile +167 -0
- package/deps/librdkafka/examples/README.md +42 -0
- package/deps/librdkafka/examples/alter_consumer_group_offsets.c +338 -0
- package/deps/librdkafka/examples/consumer.c +271 -0
- package/deps/librdkafka/examples/delete_records.c +233 -0
- package/deps/librdkafka/examples/describe_cluster.c +322 -0
- package/deps/librdkafka/examples/describe_consumer_groups.c +455 -0
- package/deps/librdkafka/examples/describe_topics.c +427 -0
- package/deps/librdkafka/examples/elect_leaders.c +317 -0
- package/deps/librdkafka/examples/globals.json +11 -0
- package/deps/librdkafka/examples/idempotent_producer.c +344 -0
- package/deps/librdkafka/examples/incremental_alter_configs.c +347 -0
- package/deps/librdkafka/examples/kafkatest_verifiable_client.cpp +945 -0
- package/deps/librdkafka/examples/list_consumer_group_offsets.c +359 -0
- package/deps/librdkafka/examples/list_consumer_groups.c +365 -0
- package/deps/librdkafka/examples/list_offsets.c +327 -0
- package/deps/librdkafka/examples/misc.c +287 -0
- package/deps/librdkafka/examples/openssl_engine_example.cpp +248 -0
- package/deps/librdkafka/examples/producer.c +251 -0
- package/deps/librdkafka/examples/producer.cpp +228 -0
- package/deps/librdkafka/examples/rdkafka_complex_consumer_example.c +617 -0
- package/deps/librdkafka/examples/rdkafka_complex_consumer_example.cpp +467 -0
- package/deps/librdkafka/examples/rdkafka_consume_batch.cpp +264 -0
- package/deps/librdkafka/examples/rdkafka_example.c +853 -0
- package/deps/librdkafka/examples/rdkafka_example.cpp +679 -0
- package/deps/librdkafka/examples/rdkafka_performance.c +1781 -0
- package/deps/librdkafka/examples/transactions-older-broker.c +668 -0
- package/deps/librdkafka/examples/transactions.c +665 -0
- package/deps/librdkafka/examples/user_scram.c +491 -0
- package/deps/librdkafka/examples/win_ssl_cert_store.cpp +396 -0
- package/deps/librdkafka/lds-gen.py +73 -0
- package/deps/librdkafka/mainpage.doxy +40 -0
- package/deps/librdkafka/mklove/Makefile.base +329 -0
- package/deps/librdkafka/mklove/modules/configure.atomics +144 -0
- package/deps/librdkafka/mklove/modules/configure.base +2484 -0
- package/deps/librdkafka/mklove/modules/configure.builtin +70 -0
- package/deps/librdkafka/mklove/modules/configure.cc +186 -0
- package/deps/librdkafka/mklove/modules/configure.cxx +8 -0
- package/deps/librdkafka/mklove/modules/configure.fileversion +65 -0
- package/deps/librdkafka/mklove/modules/configure.gitversion +29 -0
- package/deps/librdkafka/mklove/modules/configure.good_cflags +18 -0
- package/deps/librdkafka/mklove/modules/configure.host +132 -0
- package/deps/librdkafka/mklove/modules/configure.lib +49 -0
- package/deps/librdkafka/mklove/modules/configure.libcurl +99 -0
- package/deps/librdkafka/mklove/modules/configure.libsasl2 +36 -0
- package/deps/librdkafka/mklove/modules/configure.libssl +147 -0
- package/deps/librdkafka/mklove/modules/configure.libzstd +58 -0
- package/deps/librdkafka/mklove/modules/configure.parseversion +95 -0
- package/deps/librdkafka/mklove/modules/configure.pic +16 -0
- package/deps/librdkafka/mklove/modules/configure.socket +20 -0
- package/deps/librdkafka/mklove/modules/configure.zlib +61 -0
- package/deps/librdkafka/mklove/modules/patches/README.md +8 -0
- package/deps/librdkafka/mklove/modules/patches/libcurl.0000-no-runtime-linking-check.patch +11 -0
- package/deps/librdkafka/mklove/modules/patches/libssl.0000-osx-rand-include-fix-OpenSSL-PR16409.patch +56 -0
- package/deps/librdkafka/packaging/RELEASE.md +319 -0
- package/deps/librdkafka/packaging/alpine/build-alpine.sh +38 -0
- package/deps/librdkafka/packaging/archlinux/PKGBUILD +30 -0
- package/deps/librdkafka/packaging/cmake/Config.cmake.in +37 -0
- package/deps/librdkafka/packaging/cmake/Modules/FindLZ4.cmake +38 -0
- package/deps/librdkafka/packaging/cmake/Modules/FindZSTD.cmake +27 -0
- package/deps/librdkafka/packaging/cmake/Modules/LICENSE.FindZstd +178 -0
- package/deps/librdkafka/packaging/cmake/README.md +38 -0
- package/deps/librdkafka/packaging/cmake/config.h.in +52 -0
- package/deps/librdkafka/packaging/cmake/parseversion.cmake +60 -0
- package/deps/librdkafka/packaging/cmake/rdkafka.pc.in +12 -0
- package/deps/librdkafka/packaging/cmake/try_compile/atomic_32_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/atomic_64_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/c11threads_test.c +14 -0
- package/deps/librdkafka/packaging/cmake/try_compile/crc32c_hw_test.c +27 -0
- package/deps/librdkafka/packaging/cmake/try_compile/dlopen_test.c +11 -0
- package/deps/librdkafka/packaging/cmake/try_compile/libsasl2_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_darwin_test.c +6 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_freebsd_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_gnu_test.c +5 -0
- package/deps/librdkafka/packaging/cmake/try_compile/rand_r_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/rdkafka_setup.cmake +122 -0
- package/deps/librdkafka/packaging/cmake/try_compile/regex_test.c +10 -0
- package/deps/librdkafka/packaging/cmake/try_compile/strndup_test.c +5 -0
- package/deps/librdkafka/packaging/cmake/try_compile/sync_32_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/sync_64_test.c +8 -0
- package/deps/librdkafka/packaging/cp/README.md +16 -0
- package/deps/librdkafka/packaging/cp/check_features.c +72 -0
- package/deps/librdkafka/packaging/cp/verify-deb.sh +33 -0
- package/deps/librdkafka/packaging/cp/verify-packages.sh +69 -0
- package/deps/librdkafka/packaging/cp/verify-rpm.sh +32 -0
- package/deps/librdkafka/packaging/debian/changelog +66 -0
- package/deps/librdkafka/packaging/debian/compat +1 -0
- package/deps/librdkafka/packaging/debian/control +49 -0
- package/deps/librdkafka/packaging/debian/copyright +84 -0
- package/deps/librdkafka/packaging/debian/docs +5 -0
- package/deps/librdkafka/packaging/debian/gbp.conf +9 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.dirs +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.examples +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.install +6 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.substvars +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka.dsc +16 -0
- package/deps/librdkafka/packaging/debian/librdkafka1-dbg.substvars +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.dirs +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.install +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.postinst.debhelper +5 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.postrm.debhelper +5 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.symbols +64 -0
- package/deps/librdkafka/packaging/debian/rules +19 -0
- package/deps/librdkafka/packaging/debian/source/format +1 -0
- package/deps/librdkafka/packaging/debian/watch +2 -0
- package/deps/librdkafka/packaging/get_version.py +21 -0
- package/deps/librdkafka/packaging/homebrew/README.md +15 -0
- package/deps/librdkafka/packaging/homebrew/brew-update-pr.sh +31 -0
- package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw-static.sh +52 -0
- package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw.sh +21 -0
- package/deps/librdkafka/packaging/mingw-w64/export-variables.sh +13 -0
- package/deps/librdkafka/packaging/mingw-w64/run-tests.sh +6 -0
- package/deps/librdkafka/packaging/mingw-w64/semaphoreci-build.sh +38 -0
- package/deps/librdkafka/packaging/nuget/README.md +84 -0
- package/deps/librdkafka/packaging/nuget/artifact.py +177 -0
- package/deps/librdkafka/packaging/nuget/cleanup-s3.py +143 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr120.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr140.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr120.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr140.zip +0 -0
- package/deps/librdkafka/packaging/nuget/nuget.sh +21 -0
- package/deps/librdkafka/packaging/nuget/nugetpackage.py +278 -0
- package/deps/librdkafka/packaging/nuget/packaging.py +448 -0
- package/deps/librdkafka/packaging/nuget/push-to-nuget.sh +21 -0
- package/deps/librdkafka/packaging/nuget/release.py +167 -0
- package/deps/librdkafka/packaging/nuget/requirements.txt +3 -0
- package/deps/librdkafka/packaging/nuget/staticpackage.py +178 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.nuspec +21 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.props +18 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.targets +19 -0
- package/deps/librdkafka/packaging/nuget/zfile/__init__.py +0 -0
- package/deps/librdkafka/packaging/nuget/zfile/zfile.py +98 -0
- package/deps/librdkafka/packaging/rpm/Makefile +92 -0
- package/deps/librdkafka/packaging/rpm/README.md +23 -0
- package/deps/librdkafka/packaging/rpm/el7-x86_64.cfg +40 -0
- package/deps/librdkafka/packaging/rpm/librdkafka.spec +118 -0
- package/deps/librdkafka/packaging/rpm/mock-on-docker.sh +96 -0
- package/deps/librdkafka/packaging/rpm/tests/Makefile +25 -0
- package/deps/librdkafka/packaging/rpm/tests/README.md +8 -0
- package/deps/librdkafka/packaging/rpm/tests/run-test.sh +42 -0
- package/deps/librdkafka/packaging/rpm/tests/test-on-docker.sh +56 -0
- package/deps/librdkafka/packaging/rpm/tests/test.c +77 -0
- package/deps/librdkafka/packaging/rpm/tests/test.cpp +34 -0
- package/deps/librdkafka/packaging/tools/Dockerfile +31 -0
- package/deps/librdkafka/packaging/tools/build-configurations-checks.sh +12 -0
- package/deps/librdkafka/packaging/tools/build-deb-package.sh +64 -0
- package/deps/librdkafka/packaging/tools/build-debian.sh +65 -0
- package/deps/librdkafka/packaging/tools/build-manylinux.sh +68 -0
- package/deps/librdkafka/packaging/tools/build-release-artifacts.sh +139 -0
- package/deps/librdkafka/packaging/tools/distro-build.sh +38 -0
- package/deps/librdkafka/packaging/tools/gh-release-checksums.py +39 -0
- package/deps/librdkafka/packaging/tools/rdutcoverage.sh +25 -0
- package/deps/librdkafka/packaging/tools/requirements.txt +2 -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 +149 -0
- package/deps/librdkafka/packaging/tools/update_rpcs_max_versions.py +100 -0
- package/deps/librdkafka/service.yml +172 -0
- package/deps/librdkafka/src/CMakeLists.txt +374 -0
- package/deps/librdkafka/src/Makefile +103 -0
- package/deps/librdkafka/src/README.lz4.md +30 -0
- package/deps/librdkafka/src/cJSON.c +2834 -0
- package/deps/librdkafka/src/cJSON.h +398 -0
- package/deps/librdkafka/src/crc32c.c +430 -0
- package/deps/librdkafka/src/crc32c.h +38 -0
- package/deps/librdkafka/src/generate_proto.sh +66 -0
- package/deps/librdkafka/src/librdkafka_cgrp_synch.png +0 -0
- package/deps/librdkafka/src/lz4.c +2727 -0
- package/deps/librdkafka/src/lz4.h +842 -0
- package/deps/librdkafka/src/lz4frame.c +2078 -0
- package/deps/librdkafka/src/lz4frame.h +692 -0
- package/deps/librdkafka/src/lz4frame_static.h +47 -0
- package/deps/librdkafka/src/lz4hc.c +1631 -0
- package/deps/librdkafka/src/lz4hc.h +413 -0
- package/deps/librdkafka/src/nanopb/pb.h +917 -0
- package/deps/librdkafka/src/nanopb/pb_common.c +388 -0
- package/deps/librdkafka/src/nanopb/pb_common.h +49 -0
- package/deps/librdkafka/src/nanopb/pb_decode.c +1727 -0
- package/deps/librdkafka/src/nanopb/pb_decode.h +193 -0
- package/deps/librdkafka/src/nanopb/pb_encode.c +1000 -0
- package/deps/librdkafka/src/nanopb/pb_encode.h +185 -0
- package/deps/librdkafka/src/opentelemetry/common.pb.c +32 -0
- package/deps/librdkafka/src/opentelemetry/common.pb.h +170 -0
- package/deps/librdkafka/src/opentelemetry/metrics.options +2 -0
- package/deps/librdkafka/src/opentelemetry/metrics.pb.c +67 -0
- package/deps/librdkafka/src/opentelemetry/metrics.pb.h +966 -0
- package/deps/librdkafka/src/opentelemetry/resource.pb.c +12 -0
- package/deps/librdkafka/src/opentelemetry/resource.pb.h +58 -0
- package/deps/librdkafka/src/queue.h +850 -0
- package/deps/librdkafka/src/rd.h +584 -0
- package/deps/librdkafka/src/rdaddr.c +255 -0
- package/deps/librdkafka/src/rdaddr.h +202 -0
- package/deps/librdkafka/src/rdatomic.h +230 -0
- package/deps/librdkafka/src/rdavg.h +260 -0
- package/deps/librdkafka/src/rdavl.c +210 -0
- package/deps/librdkafka/src/rdavl.h +250 -0
- package/deps/librdkafka/src/rdbase64.c +200 -0
- package/deps/librdkafka/src/rdbase64.h +43 -0
- package/deps/librdkafka/src/rdbuf.c +1884 -0
- package/deps/librdkafka/src/rdbuf.h +375 -0
- package/deps/librdkafka/src/rdcrc32.c +114 -0
- package/deps/librdkafka/src/rdcrc32.h +170 -0
- package/deps/librdkafka/src/rddl.c +179 -0
- package/deps/librdkafka/src/rddl.h +43 -0
- package/deps/librdkafka/src/rdendian.h +175 -0
- package/deps/librdkafka/src/rdfloat.h +67 -0
- package/deps/librdkafka/src/rdfnv1a.c +113 -0
- package/deps/librdkafka/src/rdfnv1a.h +35 -0
- package/deps/librdkafka/src/rdgz.c +120 -0
- package/deps/librdkafka/src/rdgz.h +46 -0
- package/deps/librdkafka/src/rdhdrhistogram.c +721 -0
- package/deps/librdkafka/src/rdhdrhistogram.h +87 -0
- package/deps/librdkafka/src/rdhttp.c +830 -0
- package/deps/librdkafka/src/rdhttp.h +101 -0
- package/deps/librdkafka/src/rdinterval.h +177 -0
- package/deps/librdkafka/src/rdkafka.c +5505 -0
- package/deps/librdkafka/src/rdkafka.h +10686 -0
- package/deps/librdkafka/src/rdkafka_admin.c +9794 -0
- package/deps/librdkafka/src/rdkafka_admin.h +661 -0
- package/deps/librdkafka/src/rdkafka_assignment.c +1010 -0
- package/deps/librdkafka/src/rdkafka_assignment.h +73 -0
- package/deps/librdkafka/src/rdkafka_assignor.c +1786 -0
- package/deps/librdkafka/src/rdkafka_assignor.h +402 -0
- package/deps/librdkafka/src/rdkafka_aux.c +409 -0
- package/deps/librdkafka/src/rdkafka_aux.h +174 -0
- package/deps/librdkafka/src/rdkafka_background.c +221 -0
- package/deps/librdkafka/src/rdkafka_broker.c +6337 -0
- package/deps/librdkafka/src/rdkafka_broker.h +744 -0
- package/deps/librdkafka/src/rdkafka_buf.c +543 -0
- package/deps/librdkafka/src/rdkafka_buf.h +1525 -0
- package/deps/librdkafka/src/rdkafka_cert.c +576 -0
- package/deps/librdkafka/src/rdkafka_cert.h +62 -0
- package/deps/librdkafka/src/rdkafka_cgrp.c +7587 -0
- package/deps/librdkafka/src/rdkafka_cgrp.h +477 -0
- package/deps/librdkafka/src/rdkafka_conf.c +4880 -0
- package/deps/librdkafka/src/rdkafka_conf.h +732 -0
- package/deps/librdkafka/src/rdkafka_confval.h +97 -0
- package/deps/librdkafka/src/rdkafka_coord.c +623 -0
- package/deps/librdkafka/src/rdkafka_coord.h +132 -0
- package/deps/librdkafka/src/rdkafka_error.c +228 -0
- package/deps/librdkafka/src/rdkafka_error.h +80 -0
- package/deps/librdkafka/src/rdkafka_event.c +502 -0
- package/deps/librdkafka/src/rdkafka_event.h +126 -0
- package/deps/librdkafka/src/rdkafka_feature.c +898 -0
- package/deps/librdkafka/src/rdkafka_feature.h +104 -0
- package/deps/librdkafka/src/rdkafka_fetcher.c +1422 -0
- package/deps/librdkafka/src/rdkafka_fetcher.h +44 -0
- package/deps/librdkafka/src/rdkafka_header.c +220 -0
- package/deps/librdkafka/src/rdkafka_header.h +76 -0
- package/deps/librdkafka/src/rdkafka_idempotence.c +807 -0
- package/deps/librdkafka/src/rdkafka_idempotence.h +144 -0
- package/deps/librdkafka/src/rdkafka_int.h +1260 -0
- package/deps/librdkafka/src/rdkafka_interceptor.c +819 -0
- package/deps/librdkafka/src/rdkafka_interceptor.h +104 -0
- package/deps/librdkafka/src/rdkafka_lz4.c +450 -0
- package/deps/librdkafka/src/rdkafka_lz4.h +49 -0
- package/deps/librdkafka/src/rdkafka_metadata.c +2209 -0
- package/deps/librdkafka/src/rdkafka_metadata.h +345 -0
- package/deps/librdkafka/src/rdkafka_metadata_cache.c +1183 -0
- package/deps/librdkafka/src/rdkafka_mock.c +3661 -0
- package/deps/librdkafka/src/rdkafka_mock.h +610 -0
- package/deps/librdkafka/src/rdkafka_mock_cgrp.c +1876 -0
- package/deps/librdkafka/src/rdkafka_mock_handlers.c +3113 -0
- package/deps/librdkafka/src/rdkafka_mock_int.h +710 -0
- package/deps/librdkafka/src/rdkafka_msg.c +2589 -0
- package/deps/librdkafka/src/rdkafka_msg.h +614 -0
- package/deps/librdkafka/src/rdkafka_msgbatch.h +62 -0
- package/deps/librdkafka/src/rdkafka_msgset.h +98 -0
- package/deps/librdkafka/src/rdkafka_msgset_reader.c +1806 -0
- package/deps/librdkafka/src/rdkafka_msgset_writer.c +1474 -0
- package/deps/librdkafka/src/rdkafka_offset.c +1565 -0
- package/deps/librdkafka/src/rdkafka_offset.h +150 -0
- package/deps/librdkafka/src/rdkafka_op.c +997 -0
- package/deps/librdkafka/src/rdkafka_op.h +858 -0
- package/deps/librdkafka/src/rdkafka_partition.c +4896 -0
- package/deps/librdkafka/src/rdkafka_partition.h +1182 -0
- package/deps/librdkafka/src/rdkafka_pattern.c +228 -0
- package/deps/librdkafka/src/rdkafka_pattern.h +70 -0
- package/deps/librdkafka/src/rdkafka_plugin.c +213 -0
- package/deps/librdkafka/src/rdkafka_plugin.h +41 -0
- package/deps/librdkafka/src/rdkafka_proto.h +736 -0
- package/deps/librdkafka/src/rdkafka_protocol.h +128 -0
- package/deps/librdkafka/src/rdkafka_queue.c +1230 -0
- package/deps/librdkafka/src/rdkafka_queue.h +1220 -0
- package/deps/librdkafka/src/rdkafka_range_assignor.c +1748 -0
- package/deps/librdkafka/src/rdkafka_request.c +7089 -0
- package/deps/librdkafka/src/rdkafka_request.h +732 -0
- package/deps/librdkafka/src/rdkafka_roundrobin_assignor.c +123 -0
- package/deps/librdkafka/src/rdkafka_sasl.c +530 -0
- package/deps/librdkafka/src/rdkafka_sasl.h +63 -0
- package/deps/librdkafka/src/rdkafka_sasl_cyrus.c +722 -0
- package/deps/librdkafka/src/rdkafka_sasl_int.h +89 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.c +1833 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.h +52 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c +1666 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.h +47 -0
- package/deps/librdkafka/src/rdkafka_sasl_plain.c +142 -0
- package/deps/librdkafka/src/rdkafka_sasl_scram.c +858 -0
- package/deps/librdkafka/src/rdkafka_sasl_win32.c +550 -0
- package/deps/librdkafka/src/rdkafka_ssl.c +2129 -0
- package/deps/librdkafka/src/rdkafka_ssl.h +86 -0
- package/deps/librdkafka/src/rdkafka_sticky_assignor.c +4785 -0
- package/deps/librdkafka/src/rdkafka_subscription.c +278 -0
- package/deps/librdkafka/src/rdkafka_telemetry.c +760 -0
- package/deps/librdkafka/src/rdkafka_telemetry.h +52 -0
- package/deps/librdkafka/src/rdkafka_telemetry_decode.c +1053 -0
- package/deps/librdkafka/src/rdkafka_telemetry_decode.h +59 -0
- package/deps/librdkafka/src/rdkafka_telemetry_encode.c +997 -0
- package/deps/librdkafka/src/rdkafka_telemetry_encode.h +301 -0
- package/deps/librdkafka/src/rdkafka_timer.c +402 -0
- package/deps/librdkafka/src/rdkafka_timer.h +117 -0
- package/deps/librdkafka/src/rdkafka_topic.c +2161 -0
- package/deps/librdkafka/src/rdkafka_topic.h +334 -0
- package/deps/librdkafka/src/rdkafka_transport.c +1309 -0
- package/deps/librdkafka/src/rdkafka_transport.h +99 -0
- package/deps/librdkafka/src/rdkafka_transport_int.h +100 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.c +3256 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.h +171 -0
- package/deps/librdkafka/src/rdkafka_zstd.c +226 -0
- package/deps/librdkafka/src/rdkafka_zstd.h +57 -0
- package/deps/librdkafka/src/rdlist.c +576 -0
- package/deps/librdkafka/src/rdlist.h +434 -0
- package/deps/librdkafka/src/rdlog.c +89 -0
- package/deps/librdkafka/src/rdlog.h +41 -0
- package/deps/librdkafka/src/rdmap.c +508 -0
- package/deps/librdkafka/src/rdmap.h +492 -0
- package/deps/librdkafka/src/rdmurmur2.c +167 -0
- package/deps/librdkafka/src/rdmurmur2.h +35 -0
- package/deps/librdkafka/src/rdports.c +61 -0
- package/deps/librdkafka/src/rdports.h +38 -0
- package/deps/librdkafka/src/rdposix.h +250 -0
- package/deps/librdkafka/src/rdrand.c +80 -0
- package/deps/librdkafka/src/rdrand.h +43 -0
- package/deps/librdkafka/src/rdregex.c +156 -0
- package/deps/librdkafka/src/rdregex.h +43 -0
- package/deps/librdkafka/src/rdsignal.h +57 -0
- package/deps/librdkafka/src/rdstring.c +645 -0
- package/deps/librdkafka/src/rdstring.h +98 -0
- package/deps/librdkafka/src/rdsysqueue.h +404 -0
- package/deps/librdkafka/src/rdtime.h +356 -0
- package/deps/librdkafka/src/rdtypes.h +86 -0
- package/deps/librdkafka/src/rdunittest.c +549 -0
- package/deps/librdkafka/src/rdunittest.h +232 -0
- package/deps/librdkafka/src/rdvarint.c +134 -0
- package/deps/librdkafka/src/rdvarint.h +165 -0
- package/deps/librdkafka/src/rdwin32.h +382 -0
- package/deps/librdkafka/src/rdxxhash.c +1030 -0
- package/deps/librdkafka/src/rdxxhash.h +328 -0
- package/deps/librdkafka/src/regexp.c +1352 -0
- package/deps/librdkafka/src/regexp.h +41 -0
- package/deps/librdkafka/src/snappy.c +1866 -0
- package/deps/librdkafka/src/snappy.h +62 -0
- package/deps/librdkafka/src/snappy_compat.h +138 -0
- package/deps/librdkafka/src/statistics_schema.json +444 -0
- package/deps/librdkafka/src/tinycthread.c +932 -0
- package/deps/librdkafka/src/tinycthread.h +503 -0
- package/deps/librdkafka/src/tinycthread_extra.c +199 -0
- package/deps/librdkafka/src/tinycthread_extra.h +212 -0
- package/deps/librdkafka/src/win32_config.h +58 -0
- package/deps/librdkafka/src-cpp/CMakeLists.txt +90 -0
- package/deps/librdkafka/src-cpp/ConfImpl.cpp +84 -0
- package/deps/librdkafka/src-cpp/ConsumerImpl.cpp +244 -0
- package/deps/librdkafka/src-cpp/HandleImpl.cpp +436 -0
- package/deps/librdkafka/src-cpp/HeadersImpl.cpp +48 -0
- package/deps/librdkafka/src-cpp/KafkaConsumerImpl.cpp +296 -0
- package/deps/librdkafka/src-cpp/Makefile +55 -0
- package/deps/librdkafka/src-cpp/MessageImpl.cpp +38 -0
- package/deps/librdkafka/src-cpp/MetadataImpl.cpp +170 -0
- package/deps/librdkafka/src-cpp/ProducerImpl.cpp +197 -0
- package/deps/librdkafka/src-cpp/QueueImpl.cpp +70 -0
- package/deps/librdkafka/src-cpp/README.md +16 -0
- package/deps/librdkafka/src-cpp/RdKafka.cpp +59 -0
- package/deps/librdkafka/src-cpp/TopicImpl.cpp +124 -0
- package/deps/librdkafka/src-cpp/TopicPartitionImpl.cpp +57 -0
- package/deps/librdkafka/src-cpp/rdkafkacpp.h +3797 -0
- package/deps/librdkafka/src-cpp/rdkafkacpp_int.h +1641 -0
- package/deps/librdkafka/tests/0000-unittests.c +72 -0
- package/deps/librdkafka/tests/0001-multiobj.c +102 -0
- package/deps/librdkafka/tests/0002-unkpart.c +244 -0
- package/deps/librdkafka/tests/0003-msgmaxsize.c +173 -0
- package/deps/librdkafka/tests/0004-conf.c +934 -0
- package/deps/librdkafka/tests/0005-order.c +133 -0
- package/deps/librdkafka/tests/0006-symbols.c +163 -0
- package/deps/librdkafka/tests/0007-autotopic.c +136 -0
- package/deps/librdkafka/tests/0008-reqacks.c +179 -0
- package/deps/librdkafka/tests/0009-mock_cluster.c +97 -0
- package/deps/librdkafka/tests/0011-produce_batch.c +753 -0
- package/deps/librdkafka/tests/0012-produce_consume.c +537 -0
- package/deps/librdkafka/tests/0013-null-msgs.c +473 -0
- package/deps/librdkafka/tests/0014-reconsume-191.c +512 -0
- package/deps/librdkafka/tests/0015-offset_seeks.c +172 -0
- package/deps/librdkafka/tests/0016-client_swname.c +181 -0
- package/deps/librdkafka/tests/0017-compression.c +140 -0
- package/deps/librdkafka/tests/0018-cgrp_term.c +338 -0
- package/deps/librdkafka/tests/0019-list_groups.c +289 -0
- package/deps/librdkafka/tests/0020-destroy_hang.c +162 -0
- package/deps/librdkafka/tests/0021-rkt_destroy.c +72 -0
- package/deps/librdkafka/tests/0022-consume_batch.c +279 -0
- package/deps/librdkafka/tests/0025-timers.c +147 -0
- package/deps/librdkafka/tests/0026-consume_pause.c +547 -0
- package/deps/librdkafka/tests/0028-long_topicnames.c +79 -0
- package/deps/librdkafka/tests/0029-assign_offset.c +202 -0
- package/deps/librdkafka/tests/0030-offset_commit.c +589 -0
- package/deps/librdkafka/tests/0031-get_offsets.c +235 -0
- package/deps/librdkafka/tests/0033-regex_subscribe.c +536 -0
- package/deps/librdkafka/tests/0034-offset_reset.c +398 -0
- package/deps/librdkafka/tests/0035-api_version.c +73 -0
- package/deps/librdkafka/tests/0036-partial_fetch.c +87 -0
- package/deps/librdkafka/tests/0037-destroy_hang_local.c +85 -0
- package/deps/librdkafka/tests/0038-performance.c +121 -0
- package/deps/librdkafka/tests/0039-event.c +284 -0
- package/deps/librdkafka/tests/0040-io_event.c +257 -0
- package/deps/librdkafka/tests/0041-fetch_max_bytes.c +97 -0
- package/deps/librdkafka/tests/0042-many_topics.c +252 -0
- package/deps/librdkafka/tests/0043-no_connection.c +77 -0
- package/deps/librdkafka/tests/0044-partition_cnt.c +94 -0
- package/deps/librdkafka/tests/0045-subscribe_update.c +1010 -0
- package/deps/librdkafka/tests/0046-rkt_cache.c +65 -0
- package/deps/librdkafka/tests/0047-partial_buf_tmout.c +98 -0
- package/deps/librdkafka/tests/0048-partitioner.c +283 -0
- package/deps/librdkafka/tests/0049-consume_conn_close.c +162 -0
- package/deps/librdkafka/tests/0050-subscribe_adds.c +145 -0
- package/deps/librdkafka/tests/0051-assign_adds.c +126 -0
- package/deps/librdkafka/tests/0052-msg_timestamps.c +238 -0
- package/deps/librdkafka/tests/0053-stats_cb.cpp +527 -0
- package/deps/librdkafka/tests/0054-offset_time.cpp +236 -0
- package/deps/librdkafka/tests/0055-producer_latency.c +539 -0
- package/deps/librdkafka/tests/0056-balanced_group_mt.c +315 -0
- package/deps/librdkafka/tests/0057-invalid_topic.cpp +112 -0
- package/deps/librdkafka/tests/0058-log.cpp +123 -0
- package/deps/librdkafka/tests/0059-bsearch.cpp +241 -0
- package/deps/librdkafka/tests/0060-op_prio.cpp +163 -0
- package/deps/librdkafka/tests/0061-consumer_lag.cpp +295 -0
- package/deps/librdkafka/tests/0062-stats_event.c +126 -0
- package/deps/librdkafka/tests/0063-clusterid.cpp +180 -0
- package/deps/librdkafka/tests/0064-interceptors.c +481 -0
- package/deps/librdkafka/tests/0065-yield.cpp +140 -0
- package/deps/librdkafka/tests/0066-plugins.cpp +129 -0
- package/deps/librdkafka/tests/0067-empty_topic.cpp +151 -0
- package/deps/librdkafka/tests/0068-produce_timeout.c +136 -0
- package/deps/librdkafka/tests/0069-consumer_add_parts.c +119 -0
- package/deps/librdkafka/tests/0070-null_empty.cpp +197 -0
- package/deps/librdkafka/tests/0072-headers_ut.c +448 -0
- package/deps/librdkafka/tests/0073-headers.c +381 -0
- package/deps/librdkafka/tests/0074-producev.c +87 -0
- package/deps/librdkafka/tests/0075-retry.c +290 -0
- package/deps/librdkafka/tests/0076-produce_retry.c +452 -0
- package/deps/librdkafka/tests/0077-compaction.c +363 -0
- package/deps/librdkafka/tests/0078-c_from_cpp.cpp +96 -0
- package/deps/librdkafka/tests/0079-fork.c +93 -0
- package/deps/librdkafka/tests/0080-admin_ut.c +3095 -0
- package/deps/librdkafka/tests/0081-admin.c +5633 -0
- package/deps/librdkafka/tests/0082-fetch_max_bytes.cpp +137 -0
- package/deps/librdkafka/tests/0083-cb_event.c +233 -0
- package/deps/librdkafka/tests/0084-destroy_flags.c +208 -0
- package/deps/librdkafka/tests/0085-headers.cpp +392 -0
- package/deps/librdkafka/tests/0086-purge.c +368 -0
- package/deps/librdkafka/tests/0088-produce_metadata_timeout.c +162 -0
- package/deps/librdkafka/tests/0089-max_poll_interval.c +511 -0
- package/deps/librdkafka/tests/0090-idempotence.c +171 -0
- package/deps/librdkafka/tests/0091-max_poll_interval_timeout.c +295 -0
- package/deps/librdkafka/tests/0092-mixed_msgver.c +103 -0
- package/deps/librdkafka/tests/0093-holb.c +200 -0
- package/deps/librdkafka/tests/0094-idempotence_msg_timeout.c +231 -0
- package/deps/librdkafka/tests/0095-all_brokers_down.cpp +122 -0
- package/deps/librdkafka/tests/0097-ssl_verify.cpp +658 -0
- package/deps/librdkafka/tests/0098-consumer-txn.cpp +1218 -0
- package/deps/librdkafka/tests/0099-commit_metadata.c +194 -0
- package/deps/librdkafka/tests/0100-thread_interceptors.cpp +195 -0
- package/deps/librdkafka/tests/0101-fetch-from-follower.cpp +446 -0
- package/deps/librdkafka/tests/0102-static_group_rebalance.c +836 -0
- package/deps/librdkafka/tests/0103-transactions.c +1383 -0
- package/deps/librdkafka/tests/0104-fetch_from_follower_mock.c +625 -0
- package/deps/librdkafka/tests/0105-transactions_mock.c +3930 -0
- package/deps/librdkafka/tests/0106-cgrp_sess_timeout.c +318 -0
- package/deps/librdkafka/tests/0107-topic_recreate.c +259 -0
- package/deps/librdkafka/tests/0109-auto_create_topics.cpp +278 -0
- package/deps/librdkafka/tests/0110-batch_size.cpp +182 -0
- package/deps/librdkafka/tests/0111-delay_create_topics.cpp +127 -0
- package/deps/librdkafka/tests/0112-assign_unknown_part.c +87 -0
- package/deps/librdkafka/tests/0113-cooperative_rebalance.cpp +3473 -0
- package/deps/librdkafka/tests/0114-sticky_partitioning.cpp +176 -0
- package/deps/librdkafka/tests/0115-producer_auth.cpp +182 -0
- package/deps/librdkafka/tests/0116-kafkaconsumer_close.cpp +216 -0
- package/deps/librdkafka/tests/0117-mock_errors.c +331 -0
- package/deps/librdkafka/tests/0118-commit_rebalance.c +154 -0
- package/deps/librdkafka/tests/0119-consumer_auth.cpp +167 -0
- package/deps/librdkafka/tests/0120-asymmetric_subscription.c +185 -0
- package/deps/librdkafka/tests/0121-clusterid.c +115 -0
- package/deps/librdkafka/tests/0122-buffer_cleaning_after_rebalance.c +227 -0
- package/deps/librdkafka/tests/0123-connections_max_idle.c +98 -0
- package/deps/librdkafka/tests/0124-openssl_invalid_engine.c +69 -0
- package/deps/librdkafka/tests/0125-immediate_flush.c +144 -0
- package/deps/librdkafka/tests/0126-oauthbearer_oidc.c +528 -0
- package/deps/librdkafka/tests/0127-fetch_queue_backoff.cpp +165 -0
- package/deps/librdkafka/tests/0128-sasl_callback_queue.cpp +125 -0
- package/deps/librdkafka/tests/0129-fetch_aborted_msgs.c +79 -0
- package/deps/librdkafka/tests/0130-store_offsets.c +178 -0
- package/deps/librdkafka/tests/0131-connect_timeout.c +81 -0
- package/deps/librdkafka/tests/0132-strategy_ordering.c +179 -0
- package/deps/librdkafka/tests/0133-ssl_keys.c +150 -0
- package/deps/librdkafka/tests/0134-ssl_provider.c +92 -0
- package/deps/librdkafka/tests/0135-sasl_credentials.cpp +143 -0
- package/deps/librdkafka/tests/0136-resolve_cb.c +181 -0
- package/deps/librdkafka/tests/0137-barrier_batch_consume.c +619 -0
- package/deps/librdkafka/tests/0138-admin_mock.c +281 -0
- package/deps/librdkafka/tests/0139-offset_validation_mock.c +950 -0
- package/deps/librdkafka/tests/0140-commit_metadata.cpp +108 -0
- package/deps/librdkafka/tests/0142-reauthentication.c +515 -0
- package/deps/librdkafka/tests/0143-exponential_backoff_mock.c +552 -0
- package/deps/librdkafka/tests/0144-idempotence_mock.c +373 -0
- package/deps/librdkafka/tests/0145-pause_resume_mock.c +119 -0
- package/deps/librdkafka/tests/0146-metadata_mock.c +505 -0
- 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 +651 -0
- 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/1000-unktopic.c +164 -0
- package/deps/librdkafka/tests/8000-idle.cpp +60 -0
- package/deps/librdkafka/tests/8001-fetch_from_follower_mock_manual.c +113 -0
- package/deps/librdkafka/tests/CMakeLists.txt +170 -0
- package/deps/librdkafka/tests/LibrdkafkaTestApp.py +291 -0
- package/deps/librdkafka/tests/Makefile +182 -0
- package/deps/librdkafka/tests/README.md +509 -0
- package/deps/librdkafka/tests/autotest.sh +33 -0
- package/deps/librdkafka/tests/backtrace.gdb +30 -0
- package/deps/librdkafka/tests/broker_version_tests.py +315 -0
- package/deps/librdkafka/tests/buildbox.sh +17 -0
- package/deps/librdkafka/tests/cleanup-checker-tests.sh +20 -0
- package/deps/librdkafka/tests/cluster_testing.py +191 -0
- package/deps/librdkafka/tests/delete-test-topics.sh +56 -0
- package/deps/librdkafka/tests/fixtures/oauthbearer/jwt_assertion_template.json +10 -0
- package/deps/librdkafka/tests/fixtures/ssl/Makefile +8 -0
- package/deps/librdkafka/tests/fixtures/ssl/README.md +13 -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 +50 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.intermediate.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/create_keys.sh +168 -0
- package/deps/librdkafka/tests/fuzzers/Makefile +12 -0
- package/deps/librdkafka/tests/fuzzers/README.md +31 -0
- package/deps/librdkafka/tests/fuzzers/fuzz_regex.c +74 -0
- package/deps/librdkafka/tests/fuzzers/helpers.h +90 -0
- package/deps/librdkafka/tests/gen-ssl-certs.sh +165 -0
- package/deps/librdkafka/tests/interactive_broker_version.py +170 -0
- package/deps/librdkafka/tests/interceptor_test/CMakeLists.txt +16 -0
- package/deps/librdkafka/tests/interceptor_test/Makefile +22 -0
- package/deps/librdkafka/tests/interceptor_test/interceptor_test.c +314 -0
- package/deps/librdkafka/tests/interceptor_test/interceptor_test.h +54 -0
- package/deps/librdkafka/tests/java/IncrementalRebalanceCli.java +97 -0
- package/deps/librdkafka/tests/java/Makefile +13 -0
- package/deps/librdkafka/tests/java/Murmur2Cli.java +46 -0
- package/deps/librdkafka/tests/java/README.md +14 -0
- package/deps/librdkafka/tests/java/TransactionProducerCli.java +162 -0
- package/deps/librdkafka/tests/java/run-class.sh +11 -0
- package/deps/librdkafka/tests/librdkafka.suppressions +483 -0
- package/deps/librdkafka/tests/lz4_manual_test.sh +59 -0
- package/deps/librdkafka/tests/multi-broker-version-test.sh +50 -0
- package/deps/librdkafka/tests/parse-refcnt.sh +43 -0
- package/deps/librdkafka/tests/performance_plot.py +115 -0
- package/deps/librdkafka/tests/plugin_test/Makefile +19 -0
- package/deps/librdkafka/tests/plugin_test/plugin_test.c +58 -0
- package/deps/librdkafka/tests/requirements.txt +2 -0
- package/deps/librdkafka/tests/run-all-tests.sh +79 -0
- package/deps/librdkafka/tests/run-consumer-tests.sh +16 -0
- package/deps/librdkafka/tests/run-producer-tests.sh +16 -0
- package/deps/librdkafka/tests/run-test-batches.py +157 -0
- package/deps/librdkafka/tests/run-test.sh +140 -0
- package/deps/librdkafka/tests/rusage.c +249 -0
- package/deps/librdkafka/tests/sasl_test.py +289 -0
- package/deps/librdkafka/tests/scenarios/README.md +6 -0
- package/deps/librdkafka/tests/scenarios/ak23.json +6 -0
- package/deps/librdkafka/tests/scenarios/default.json +5 -0
- package/deps/librdkafka/tests/scenarios/noautocreate.json +5 -0
- package/deps/librdkafka/tests/sockem.c +801 -0
- package/deps/librdkafka/tests/sockem.h +85 -0
- package/deps/librdkafka/tests/sockem_ctrl.c +145 -0
- package/deps/librdkafka/tests/sockem_ctrl.h +61 -0
- package/deps/librdkafka/tests/test.c +7778 -0
- package/deps/librdkafka/tests/test.conf.example +27 -0
- package/deps/librdkafka/tests/test.h +1028 -0
- package/deps/librdkafka/tests/testcpp.cpp +131 -0
- package/deps/librdkafka/tests/testcpp.h +388 -0
- package/deps/librdkafka/tests/testshared.h +416 -0
- package/deps/librdkafka/tests/tools/README.md +4 -0
- package/deps/librdkafka/tests/tools/stats/README.md +21 -0
- package/deps/librdkafka/tests/tools/stats/filter.jq +42 -0
- package/deps/librdkafka/tests/tools/stats/graph.py +150 -0
- package/deps/librdkafka/tests/tools/stats/requirements.txt +3 -0
- package/deps/librdkafka/tests/tools/stats/to_csv.py +124 -0
- package/deps/librdkafka/tests/trivup/trivup-0.14.0.tar.gz +0 -0
- package/deps/librdkafka/tests/until-fail.sh +87 -0
- package/deps/librdkafka/tests/xxxx-assign_partition.c +122 -0
- package/deps/librdkafka/tests/xxxx-metadata.cpp +159 -0
- package/deps/librdkafka/vcpkg.json +23 -0
- package/deps/librdkafka/win32/README.md +5 -0
- package/deps/librdkafka/win32/build-package.bat +3 -0
- package/deps/librdkafka/win32/build.bat +19 -0
- package/deps/librdkafka/win32/common.vcxproj +84 -0
- package/deps/librdkafka/win32/interceptor_test/interceptor_test.vcxproj +87 -0
- package/deps/librdkafka/win32/librdkafka.autopkg.template +54 -0
- package/deps/librdkafka/win32/librdkafka.master.testing.targets +13 -0
- package/deps/librdkafka/win32/librdkafka.sln +226 -0
- package/deps/librdkafka/win32/librdkafka.vcxproj +276 -0
- package/deps/librdkafka/win32/librdkafkacpp/librdkafkacpp.vcxproj +104 -0
- package/deps/librdkafka/win32/msbuild.ps1 +15 -0
- package/deps/librdkafka/win32/openssl_engine_example/openssl_engine_example.vcxproj +132 -0
- package/deps/librdkafka/win32/package-zip.ps1 +46 -0
- package/deps/librdkafka/win32/packages/repositories.config +4 -0
- package/deps/librdkafka/win32/push-package.bat +4 -0
- package/deps/librdkafka/win32/rdkafka_complex_consumer_example_cpp/rdkafka_complex_consumer_example_cpp.vcxproj +67 -0
- package/deps/librdkafka/win32/rdkafka_example/rdkafka_example.vcxproj +97 -0
- package/deps/librdkafka/win32/rdkafka_performance/rdkafka_performance.vcxproj +97 -0
- package/deps/librdkafka/win32/setup-msys2.ps1 +47 -0
- package/deps/librdkafka/win32/setup-vcpkg.ps1 +34 -0
- package/deps/librdkafka/win32/tests/test.conf.example +25 -0
- package/deps/librdkafka/win32/tests/tests.vcxproj +253 -0
- package/deps/librdkafka/win32/win_ssl_cert_store/win_ssl_cert_store.vcxproj +132 -0
- package/deps/librdkafka/win32/wingetopt.c +564 -0
- package/deps/librdkafka/win32/wingetopt.h +101 -0
- package/deps/librdkafka/win32/wintime.h +33 -0
- package/deps/librdkafka.gyp +62 -0
- package/lib/admin.js +233 -0
- package/lib/client.js +573 -0
- package/lib/error.js +500 -0
- package/lib/index.js +34 -0
- package/lib/kafka-consumer-stream.js +397 -0
- package/lib/kafka-consumer.js +698 -0
- package/lib/producer/high-level-producer.js +323 -0
- package/lib/producer-stream.js +307 -0
- package/lib/producer.js +375 -0
- package/lib/tools/ref-counter.js +52 -0
- package/lib/topic-partition.js +88 -0
- package/lib/topic.js +42 -0
- package/lib/util.js +29 -0
- package/package.json +61 -0
- package/prebuilds/darwin-arm64/@point3+node-rdkafka.node +0 -0
- package/prebuilds/linux-x64/@point3+node-rdkafka.node +0 -0
- package/util/configure.js +30 -0
- package/util/get-env.js +6 -0
- package/util/test-compile.js +11 -0
- package/util/test-producer-delivery.js +100 -0
|
@@ -0,0 +1,952 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* librdkafka - Apache Kafka C library
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2024, Confluent Inc.
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
|
9
|
+
*
|
|
10
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer.
|
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
* and/or other materials provided with the distribution.
|
|
15
|
+
*
|
|
16
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
19
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
20
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
21
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
22
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
23
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
24
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
25
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
26
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
#include "test.h"
|
|
30
|
+
|
|
31
|
+
#include "../src/rdkafka_proto.h"
|
|
32
|
+
|
|
33
|
+
#include <stdarg.h>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @name Mock tests specific of the KIP-848 group consumer protocol
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @enum test_variation_t
|
|
43
|
+
* @brief Variations for most error case tests.
|
|
44
|
+
*/
|
|
45
|
+
typedef enum test_variation_t {
|
|
46
|
+
/* Error happens on first HB */
|
|
47
|
+
TEST_VARIATION_ERROR_FIRST_HB = 0,
|
|
48
|
+
/* Error happens on second HB */
|
|
49
|
+
TEST_VARIATION_ERROR_SECOND_HB = 1,
|
|
50
|
+
TEST_VARIATION__CNT,
|
|
51
|
+
} test_variation_t;
|
|
52
|
+
|
|
53
|
+
static const char *test_variation_name(test_variation_t variation) {
|
|
54
|
+
rd_assert(variation >= TEST_VARIATION_ERROR_FIRST_HB &&
|
|
55
|
+
variation < TEST_VARIATION__CNT);
|
|
56
|
+
static const char *names[] = {"error on first heartbeat",
|
|
57
|
+
"error on second heartbeat"};
|
|
58
|
+
return names[variation];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static int allowed_error;
|
|
62
|
+
static int rebalance_cnt;
|
|
63
|
+
static rd_kafka_resp_err_t rebalance_exp_event;
|
|
64
|
+
static rd_bool_t rebalance_exp_lost = rd_false;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @brief Decide what error_cb's will cause the test to fail.
|
|
68
|
+
*/
|
|
69
|
+
static int
|
|
70
|
+
error_is_fatal_cb(rd_kafka_t *rk, rd_kafka_resp_err_t err, const char *reason) {
|
|
71
|
+
if (err == allowed_error ||
|
|
72
|
+
/* If transport errors are allowed then it is likely
|
|
73
|
+
* that we'll also see ALL_BROKERS_DOWN. */
|
|
74
|
+
(allowed_error == RD_KAFKA_RESP_ERR__TRANSPORT &&
|
|
75
|
+
err == RD_KAFKA_RESP_ERR__ALL_BROKERS_DOWN)) {
|
|
76
|
+
TEST_SAY("Ignoring allowed error: %s: %s\n",
|
|
77
|
+
rd_kafka_err2name(err), reason);
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
return 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @brief Rebalance callback saving number of calls and verifying expected
|
|
85
|
+
* event.
|
|
86
|
+
*/
|
|
87
|
+
static void rebalance_cb(rd_kafka_t *rk,
|
|
88
|
+
rd_kafka_resp_err_t err,
|
|
89
|
+
rd_kafka_topic_partition_list_t *parts,
|
|
90
|
+
void *opaque) {
|
|
91
|
+
|
|
92
|
+
rebalance_cnt++;
|
|
93
|
+
TEST_SAY("Rebalance #%d: %s: %d partition(s)\n", rebalance_cnt,
|
|
94
|
+
rd_kafka_err2name(err), parts->cnt);
|
|
95
|
+
|
|
96
|
+
TEST_ASSERT(
|
|
97
|
+
err == rebalance_exp_event, "Expected rebalance event %s, not %s",
|
|
98
|
+
rd_kafka_err2name(rebalance_exp_event), rd_kafka_err2name(err));
|
|
99
|
+
|
|
100
|
+
if (rebalance_exp_lost) {
|
|
101
|
+
TEST_ASSERT(rd_kafka_assignment_lost(rk),
|
|
102
|
+
"Expected partitions lost");
|
|
103
|
+
TEST_SAY("Partitions were lost\n");
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
test_rebalance_cb(rk, err, parts, opaque);
|
|
107
|
+
|
|
108
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR_NO_ERROR;
|
|
109
|
+
/* Make sure only one rebalance callback is served per poll()
|
|
110
|
+
* so that expect_rebalance() returns to the test logic on each
|
|
111
|
+
* rebalance. */
|
|
112
|
+
rd_kafka_yield(rk);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static rd_bool_t is_heartbeat_request(rd_kafka_mock_request_t *request,
|
|
116
|
+
void *opaque) {
|
|
117
|
+
return rd_kafka_mock_request_api_key(request) ==
|
|
118
|
+
RD_KAFKAP_ConsumerGroupHeartbeat;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @brief Wait at least \p num heartbeats
|
|
123
|
+
* have been received by the mock cluster
|
|
124
|
+
* plus \p confidence_interval has passed
|
|
125
|
+
*
|
|
126
|
+
* @return Number of heartbeats received.
|
|
127
|
+
*/
|
|
128
|
+
static int wait_all_heartbeats_done(rd_kafka_mock_cluster_t *mcluster,
|
|
129
|
+
int num,
|
|
130
|
+
int confidence_interval) {
|
|
131
|
+
return test_mock_wait_matching_requests(
|
|
132
|
+
mcluster, num, confidence_interval, is_heartbeat_request, NULL);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
static rd_kafka_t *create_consumer(const char *bootstraps,
|
|
136
|
+
const char *group_id,
|
|
137
|
+
rd_bool_t with_rebalance_cb) {
|
|
138
|
+
rd_kafka_conf_t *conf;
|
|
139
|
+
test_conf_init(&conf, NULL, 0);
|
|
140
|
+
test_conf_set(conf, "bootstrap.servers", bootstraps);
|
|
141
|
+
test_conf_set(conf, "auto.offset.reset", "earliest");
|
|
142
|
+
return test_create_consumer(
|
|
143
|
+
group_id, with_rebalance_cb ? rebalance_cb : NULL, conf, NULL);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @brief Test heartbeat behavior with fatal errors,
|
|
148
|
+
* ensuring:
|
|
149
|
+
* - a fatal error is received on poll and consumer close
|
|
150
|
+
* - sequence:
|
|
151
|
+
* - in TEST_VARIATION_ERROR_FIRST_HB (1 HBs, 0 callbacks):
|
|
152
|
+
* - first HB returns a fatal error
|
|
153
|
+
* - no rebalance callbacks are called after that
|
|
154
|
+
* - all operations on the consumer fail with fatal error \p err
|
|
155
|
+
* - no final leave group HB is sent
|
|
156
|
+
*
|
|
157
|
+
* - in TEST_VARIATION_ERROR_SECOND_HB (2 HBs, 1 assignment callback):
|
|
158
|
+
* - first HB receives assignment
|
|
159
|
+
* - an assignment callback is called
|
|
160
|
+
* - second HB acknowledges the assignment and returns a fatal error.
|
|
161
|
+
* - no rebalance callbacks are called after that
|
|
162
|
+
* - all operations on the consumer fail with fatal error \p err.
|
|
163
|
+
* - no final leave group HB is sent
|
|
164
|
+
*
|
|
165
|
+
* @param err The error code to test.
|
|
166
|
+
* @param variation Test variation, see `test_variation_t`.
|
|
167
|
+
*/
|
|
168
|
+
static void
|
|
169
|
+
do_test_consumer_group_heartbeat_fatal_error(rd_kafka_resp_err_t err,
|
|
170
|
+
test_variation_t variation) {
|
|
171
|
+
rd_kafka_mock_cluster_t *mcluster;
|
|
172
|
+
const char *bootstraps;
|
|
173
|
+
rd_kafka_topic_partition_list_t *subscription;
|
|
174
|
+
rd_kafka_t *c;
|
|
175
|
+
rd_kafka_message_t *rkmessage;
|
|
176
|
+
rd_kafka_resp_err_t fatal_error;
|
|
177
|
+
int expected_heartbeats, found_heartbeats, expected_rebalance_cnt;
|
|
178
|
+
test_timing_t timing;
|
|
179
|
+
rebalance_cnt = 0;
|
|
180
|
+
rebalance_exp_lost = rd_false;
|
|
181
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR_NO_ERROR;
|
|
182
|
+
const char *topic = test_mk_topic_name(__FUNCTION__, 0);
|
|
183
|
+
char errstr[512];
|
|
184
|
+
|
|
185
|
+
SUB_TEST_QUICK("%s, variation: %s", rd_kafka_err2name(err),
|
|
186
|
+
test_variation_name(variation));
|
|
187
|
+
|
|
188
|
+
mcluster = test_mock_cluster_new(1, &bootstraps);
|
|
189
|
+
rd_kafka_mock_set_group_consumer_heartbeat_interval_ms(mcluster, 1000);
|
|
190
|
+
rd_kafka_mock_topic_create(mcluster, topic, 1, 1);
|
|
191
|
+
|
|
192
|
+
TIMING_START(&timing, "consumer_group_heartbeat_fatal_error");
|
|
193
|
+
|
|
194
|
+
if (variation == TEST_VARIATION_ERROR_SECOND_HB) {
|
|
195
|
+
/* First HB returns assignment */
|
|
196
|
+
rd_kafka_mock_broker_push_request_error_rtts(
|
|
197
|
+
mcluster, 1, RD_KAFKAP_ConsumerGroupHeartbeat, 1,
|
|
198
|
+
RD_KAFKA_RESP_ERR_NO_ERROR, 0);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
rd_kafka_mock_broker_push_request_error_rtts(
|
|
202
|
+
mcluster, 1, RD_KAFKAP_ConsumerGroupHeartbeat, 1, err, 0);
|
|
203
|
+
|
|
204
|
+
c = create_consumer(bootstraps, topic, rd_true);
|
|
205
|
+
|
|
206
|
+
/* Subscribe to the input topic */
|
|
207
|
+
subscription = rd_kafka_topic_partition_list_new(1);
|
|
208
|
+
rd_kafka_topic_partition_list_add(subscription, topic,
|
|
209
|
+
/* The partition is ignored in
|
|
210
|
+
* rd_kafka_subscribe() */
|
|
211
|
+
RD_KAFKA_PARTITION_UA);
|
|
212
|
+
|
|
213
|
+
TEST_SAY("Subscribing to topic\n");
|
|
214
|
+
rd_kafka_mock_start_request_tracking(mcluster);
|
|
215
|
+
TEST_CALL_ERR__(rd_kafka_subscribe(c, subscription));
|
|
216
|
+
rd_kafka_topic_partition_list_destroy(subscription);
|
|
217
|
+
|
|
218
|
+
expected_heartbeats = 1;
|
|
219
|
+
|
|
220
|
+
TEST_SAY("Awaiting all HBs\n");
|
|
221
|
+
TEST_ASSERT((found_heartbeats =
|
|
222
|
+
wait_all_heartbeats_done(mcluster, expected_heartbeats,
|
|
223
|
+
200)) == expected_heartbeats,
|
|
224
|
+
"Expected %d heartbeats, got %d", expected_heartbeats,
|
|
225
|
+
found_heartbeats);
|
|
226
|
+
|
|
227
|
+
expected_rebalance_cnt = 0;
|
|
228
|
+
if (variation == TEST_VARIATION_ERROR_SECOND_HB) {
|
|
229
|
+
expected_rebalance_cnt++;
|
|
230
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
231
|
+
|
|
232
|
+
/* Trigger rebalance cb */
|
|
233
|
+
rkmessage = rd_kafka_consumer_poll(c, 500);
|
|
234
|
+
TEST_ASSERT(!rkmessage, "No message should be returned");
|
|
235
|
+
TEST_ASSERT(
|
|
236
|
+
rebalance_exp_event == RD_KAFKA_RESP_ERR_NO_ERROR,
|
|
237
|
+
"Expected assign callback to be processed, but it wasn't");
|
|
238
|
+
|
|
239
|
+
/* Expect the acknowledge HB*/
|
|
240
|
+
expected_heartbeats++;
|
|
241
|
+
TEST_ASSERT((found_heartbeats = wait_all_heartbeats_done(
|
|
242
|
+
mcluster, expected_heartbeats, 200)) ==
|
|
243
|
+
expected_heartbeats,
|
|
244
|
+
"Expected %d heartbeats, got %d",
|
|
245
|
+
expected_heartbeats, found_heartbeats);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
rd_kafka_mock_clear_requests(mcluster);
|
|
249
|
+
TEST_SAY("Consume from c, a fatal error is returned\n");
|
|
250
|
+
rkmessage = rd_kafka_consumer_poll(c, 500);
|
|
251
|
+
TEST_ASSERT(rkmessage != NULL, "An error message should be returned");
|
|
252
|
+
TEST_ASSERT(rkmessage->err == RD_KAFKA_RESP_ERR__FATAL,
|
|
253
|
+
"Expected a _FATAL error, got %s",
|
|
254
|
+
rd_kafka_err2name(rkmessage->err));
|
|
255
|
+
fatal_error = rd_kafka_fatal_error(c, errstr, sizeof(errstr));
|
|
256
|
+
TEST_ASSERT(fatal_error == err, "Expected fatal error %s, got %s",
|
|
257
|
+
rd_kafka_err2name(err), rd_kafka_err2name(fatal_error));
|
|
258
|
+
rd_kafka_message_destroy(rkmessage);
|
|
259
|
+
|
|
260
|
+
TEST_ASSERT(rebalance_cnt == expected_rebalance_cnt,
|
|
261
|
+
"Expected %d rebalance events, got %d",
|
|
262
|
+
expected_rebalance_cnt, rebalance_cnt);
|
|
263
|
+
|
|
264
|
+
/* Close c, a fatal error is returned */
|
|
265
|
+
TEST_ASSERT(rd_kafka_consumer_close(c) == RD_KAFKA_RESP_ERR__FATAL,
|
|
266
|
+
"Expected a _FATAL error, got %s", rd_kafka_err2name(err));
|
|
267
|
+
fatal_error = rd_kafka_fatal_error(c, errstr, sizeof(errstr));
|
|
268
|
+
TEST_ASSERT(fatal_error == err, "Expected fatal error %s, got %s",
|
|
269
|
+
rd_kafka_err2name(err), rd_kafka_err2name(fatal_error));
|
|
270
|
+
|
|
271
|
+
TEST_ASSERT(rebalance_cnt == expected_rebalance_cnt,
|
|
272
|
+
"Expected %d rebalance events, got %d",
|
|
273
|
+
expected_rebalance_cnt, rebalance_cnt);
|
|
274
|
+
|
|
275
|
+
rd_kafka_destroy(c);
|
|
276
|
+
|
|
277
|
+
TEST_SAY("Ensuring there are no leave group HBs\n");
|
|
278
|
+
TEST_ASSERT(
|
|
279
|
+
(found_heartbeats = wait_all_heartbeats_done(mcluster, 0, 0)) == 0,
|
|
280
|
+
"Expected no leave group heartbeat, got %d", found_heartbeats);
|
|
281
|
+
rd_kafka_mock_stop_request_tracking(mcluster);
|
|
282
|
+
test_mock_cluster_destroy(mcluster);
|
|
283
|
+
|
|
284
|
+
TIMING_ASSERT(&timing, 100, 1500);
|
|
285
|
+
SUB_TEST_PASS();
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @brief Test all kind of fatal errors in a ConsumerGroupHeartbeat call.
|
|
290
|
+
* @sa test_variation_t
|
|
291
|
+
*/
|
|
292
|
+
static void do_test_consumer_group_heartbeat_fatal_errors(void) {
|
|
293
|
+
rd_kafka_resp_err_t fatal_errors[] = {
|
|
294
|
+
RD_KAFKA_RESP_ERR_INVALID_REQUEST,
|
|
295
|
+
RD_KAFKA_RESP_ERR_GROUP_MAX_SIZE_REACHED,
|
|
296
|
+
RD_KAFKA_RESP_ERR_UNSUPPORTED_ASSIGNOR,
|
|
297
|
+
RD_KAFKA_RESP_ERR_UNSUPPORTED_VERSION,
|
|
298
|
+
RD_KAFKA_RESP_ERR_UNRELEASED_INSTANCE_ID,
|
|
299
|
+
RD_KAFKA_RESP_ERR_GROUP_AUTHORIZATION_FAILED};
|
|
300
|
+
size_t i;
|
|
301
|
+
test_variation_t j;
|
|
302
|
+
for (i = 0; i < RD_ARRAY_SIZE(fatal_errors); i++) {
|
|
303
|
+
/* Only these errors can happen on a second HB. */
|
|
304
|
+
test_variation_t last_variation =
|
|
305
|
+
((fatal_errors[i] == RD_KAFKA_RESP_ERR_INVALID_REQUEST) ||
|
|
306
|
+
(fatal_errors[i] ==
|
|
307
|
+
RD_KAFKA_RESP_ERR_GROUP_AUTHORIZATION_FAILED))
|
|
308
|
+
? TEST_VARIATION_ERROR_SECOND_HB
|
|
309
|
+
: TEST_VARIATION_ERROR_FIRST_HB;
|
|
310
|
+
|
|
311
|
+
for (j = TEST_VARIATION_ERROR_FIRST_HB; j <= last_variation;
|
|
312
|
+
j++)
|
|
313
|
+
do_test_consumer_group_heartbeat_fatal_error(
|
|
314
|
+
fatal_errors[i], j);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* @brief Test heartbeat behavior with retriable errors,
|
|
320
|
+
* ensuring:
|
|
321
|
+
* - no error is received on poll and consumer close
|
|
322
|
+
* - sequence:
|
|
323
|
+
* - in TEST_VARIATION_ERROR_FIRST_HB (4 HBs, 1 assignment callback, 1
|
|
324
|
+
* revocation callback):
|
|
325
|
+
* - first HB is retried
|
|
326
|
+
* - second HB receives assignment
|
|
327
|
+
* - rebalance callback with an assignment
|
|
328
|
+
* - third HB for the acknowledgment
|
|
329
|
+
* - assignment revoked with a callback on consumer close
|
|
330
|
+
* - final leave group HB
|
|
331
|
+
*
|
|
332
|
+
* - in TEST_VARIATION_ERROR_SECOND_HB (4 HBs, 1 assignment callback, 1
|
|
333
|
+
* revocation callback):
|
|
334
|
+
* - first HB receives assignment
|
|
335
|
+
* - assignment callback is called
|
|
336
|
+
* - second HB acknowledges the assignment and
|
|
337
|
+
* returns a retriable error
|
|
338
|
+
* - the HB is retried (third one)
|
|
339
|
+
* - assignment revoked with a callback on consumer close
|
|
340
|
+
* - final leave group HB
|
|
341
|
+
*
|
|
342
|
+
* @param err The error code to test.
|
|
343
|
+
* @param variation Test variation, see `test_variation_t`.
|
|
344
|
+
*/
|
|
345
|
+
static void
|
|
346
|
+
do_test_consumer_group_heartbeat_retriable_error(rd_kafka_resp_err_t err,
|
|
347
|
+
test_variation_t variation) {
|
|
348
|
+
rd_kafka_mock_cluster_t *mcluster;
|
|
349
|
+
const char *bootstraps;
|
|
350
|
+
rd_kafka_topic_partition_list_t *subscription;
|
|
351
|
+
rd_kafka_t *c;
|
|
352
|
+
int expected_heartbeats, found_heartbeats;
|
|
353
|
+
test_timing_t timing;
|
|
354
|
+
const char *topic = test_mk_topic_name(__FUNCTION__, 0);
|
|
355
|
+
test_curr->is_fatal_cb = error_is_fatal_cb;
|
|
356
|
+
rebalance_cnt = 0;
|
|
357
|
+
rebalance_exp_lost = rd_false;
|
|
358
|
+
allowed_error = RD_KAFKA_RESP_ERR__TRANSPORT;
|
|
359
|
+
|
|
360
|
+
SUB_TEST_QUICK("%s, variation: %s", rd_kafka_err2name(err),
|
|
361
|
+
test_variation_name(variation));
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
mcluster = test_mock_cluster_new(1, &bootstraps);
|
|
365
|
+
rd_kafka_mock_set_group_consumer_heartbeat_interval_ms(mcluster, 1000);
|
|
366
|
+
rd_kafka_mock_topic_create(mcluster, topic, 1, 1);
|
|
367
|
+
|
|
368
|
+
c = create_consumer(bootstraps, topic, rd_true);
|
|
369
|
+
|
|
370
|
+
TIMING_START(&timing, "consumer_group_heartbeat_retriable_error");
|
|
371
|
+
|
|
372
|
+
if (variation == TEST_VARIATION_ERROR_SECOND_HB) {
|
|
373
|
+
/* First HB returns assignment */
|
|
374
|
+
rd_kafka_mock_broker_push_request_error_rtts(
|
|
375
|
+
mcluster, 1, RD_KAFKAP_ConsumerGroupHeartbeat, 1,
|
|
376
|
+
RD_KAFKA_RESP_ERR_NO_ERROR, 0);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
rd_kafka_mock_broker_push_request_error_rtts(
|
|
380
|
+
mcluster, 1, RD_KAFKAP_ConsumerGroupHeartbeat, 1, err, 0);
|
|
381
|
+
|
|
382
|
+
/* Subscribe to the input topic */
|
|
383
|
+
subscription = rd_kafka_topic_partition_list_new(1);
|
|
384
|
+
rd_kafka_topic_partition_list_add(subscription, topic,
|
|
385
|
+
/* The partition is ignored in
|
|
386
|
+
* rd_kafka_subscribe() */
|
|
387
|
+
RD_KAFKA_PARTITION_UA);
|
|
388
|
+
|
|
389
|
+
TEST_SAY("Subscribing to topic\n");
|
|
390
|
+
rd_kafka_mock_start_request_tracking(mcluster);
|
|
391
|
+
TEST_CALL_ERR__(rd_kafka_subscribe(c, subscription));
|
|
392
|
+
rd_kafka_topic_partition_list_destroy(subscription);
|
|
393
|
+
|
|
394
|
+
/* TEST_VARIATION_ERROR_FIRST_HB First HB and its retry + ACK. */
|
|
395
|
+
/* TEST_VARIATION_ERROR_SECOND_HB First HB + ACK and retry. */
|
|
396
|
+
expected_heartbeats = 3;
|
|
397
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
398
|
+
TEST_SAY(
|
|
399
|
+
"Consume from c, no message is returned, "
|
|
400
|
+
"but assign callback is processed\n");
|
|
401
|
+
test_consumer_poll_no_msgs("after heartbeat", c, 0, 500);
|
|
402
|
+
TEST_ASSERT(rebalance_cnt > 0, "Expected > 0 rebalance events, got %d",
|
|
403
|
+
rebalance_cnt);
|
|
404
|
+
TEST_ASSERT(rebalance_exp_event == RD_KAFKA_RESP_ERR_NO_ERROR,
|
|
405
|
+
"Expected assign callback to be processed, but it wasn't");
|
|
406
|
+
|
|
407
|
+
TEST_SAY("Awaiting first HBs\n");
|
|
408
|
+
TEST_ASSERT((found_heartbeats =
|
|
409
|
+
wait_all_heartbeats_done(mcluster, expected_heartbeats,
|
|
410
|
+
200)) == expected_heartbeats,
|
|
411
|
+
"Expected %d heartbeats, got %d", expected_heartbeats,
|
|
412
|
+
found_heartbeats);
|
|
413
|
+
|
|
414
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
415
|
+
|
|
416
|
+
/* Close c without errors */
|
|
417
|
+
expected_heartbeats++;
|
|
418
|
+
TEST_ASSERT(rd_kafka_consumer_close(c) == RD_KAFKA_RESP_ERR_NO_ERROR,
|
|
419
|
+
"Expected NO_ERROR, got %s", rd_kafka_err2name(err));
|
|
420
|
+
TEST_ASSERT(rebalance_cnt > 0, "Expected > 0 rebalance events, got %d",
|
|
421
|
+
rebalance_cnt);
|
|
422
|
+
TEST_ASSERT(rebalance_exp_event == RD_KAFKA_RESP_ERR_NO_ERROR,
|
|
423
|
+
"Expected revoke callback to be processed, but it wasn't");
|
|
424
|
+
|
|
425
|
+
rd_kafka_destroy(c);
|
|
426
|
+
|
|
427
|
+
TEST_SAY("Awaiting leave group HB\n");
|
|
428
|
+
TEST_ASSERT((found_heartbeats =
|
|
429
|
+
wait_all_heartbeats_done(mcluster, expected_heartbeats,
|
|
430
|
+
0)) == expected_heartbeats,
|
|
431
|
+
"Expected %d heartbeats, got %d", expected_heartbeats,
|
|
432
|
+
found_heartbeats);
|
|
433
|
+
|
|
434
|
+
rd_kafka_mock_stop_request_tracking(mcluster);
|
|
435
|
+
test_mock_cluster_destroy(mcluster);
|
|
436
|
+
|
|
437
|
+
TIMING_ASSERT(&timing, 100, 1500);
|
|
438
|
+
|
|
439
|
+
test_curr->is_fatal_cb = NULL;
|
|
440
|
+
allowed_error = RD_KAFKA_RESP_ERR_NO_ERROR;
|
|
441
|
+
|
|
442
|
+
SUB_TEST_PASS();
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* @brief Test all kind of retriable errors in a ConsumerGroupHeartbeat call.
|
|
447
|
+
* @sa test_variation_t
|
|
448
|
+
*/
|
|
449
|
+
static void do_test_consumer_group_heartbeat_retriable_errors(void) {
|
|
450
|
+
rd_kafka_resp_err_t retriable_errors[] = {
|
|
451
|
+
RD_KAFKA_RESP_ERR_COORDINATOR_LOAD_IN_PROGRESS,
|
|
452
|
+
RD_KAFKA_RESP_ERR__SSL, RD_KAFKA_RESP_ERR__TIMED_OUT_QUEUE};
|
|
453
|
+
size_t i;
|
|
454
|
+
test_variation_t j;
|
|
455
|
+
for (i = 0; i < RD_ARRAY_SIZE(retriable_errors); i++) {
|
|
456
|
+
for (j = TEST_VARIATION_ERROR_FIRST_HB; j < TEST_VARIATION__CNT;
|
|
457
|
+
j++)
|
|
458
|
+
do_test_consumer_group_heartbeat_retriable_error(
|
|
459
|
+
retriable_errors[i], j);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @brief Test heartbeat behavior with consumer fenced errors,
|
|
465
|
+
* ensuring:
|
|
466
|
+
* - no error is received on poll and consumer close
|
|
467
|
+
* - sequence:
|
|
468
|
+
*
|
|
469
|
+
* - in TEST_VARIATION_ERROR_FIRST_HB (4 HBs, 1 assignment callback, 1
|
|
470
|
+
* revocation callback):
|
|
471
|
+
* - first HB fences the member
|
|
472
|
+
* it does not receives assignment
|
|
473
|
+
* or revoke any partitions
|
|
474
|
+
* - second HB receives assignment
|
|
475
|
+
* - there's an assignment callback
|
|
476
|
+
* - assignment is acknowledged (third HB)
|
|
477
|
+
* - assignment is revoked on close (fourth HB)
|
|
478
|
+
* - last revoke callback
|
|
479
|
+
*
|
|
480
|
+
* - in TEST_VARIATION_ERROR_SECOND_HB (5 HBs, 2 assignment callbacks,
|
|
481
|
+
* 2 revocation callbacks of which 1 as lost):
|
|
482
|
+
* - first HB receives assignment
|
|
483
|
+
* - assignment callback is called
|
|
484
|
+
* - second HB acknowledges the assignment, fences the consumer
|
|
485
|
+
* - a lost callback is called (lost partitions)
|
|
486
|
+
* - partitions are assigned again on re-joining (third HB)
|
|
487
|
+
* - second assignment callback
|
|
488
|
+
* - acknowledgment of the assignment (fourth HB)
|
|
489
|
+
* - partitions are revoked on close (fifth HB)
|
|
490
|
+
* - last revoke callback
|
|
491
|
+
*
|
|
492
|
+
* @param err The error code to test.
|
|
493
|
+
* @param variation Test variation, see `test_variation_t`.
|
|
494
|
+
*/
|
|
495
|
+
static void
|
|
496
|
+
do_test_consumer_group_heartbeat_fenced_error(rd_kafka_resp_err_t err,
|
|
497
|
+
test_variation_t variation) {
|
|
498
|
+
rd_kafka_mock_cluster_t *mcluster;
|
|
499
|
+
const char *bootstraps;
|
|
500
|
+
rd_kafka_topic_partition_list_t *subscription;
|
|
501
|
+
rd_kafka_t *c;
|
|
502
|
+
rd_kafka_message_t *rkmessage;
|
|
503
|
+
int expected_heartbeats, found_heartbeats, expected_rebalance_cnt;
|
|
504
|
+
test_timing_t timing;
|
|
505
|
+
rebalance_cnt = 0;
|
|
506
|
+
rebalance_exp_lost = rd_false;
|
|
507
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR_NO_ERROR;
|
|
508
|
+
const char *topic = test_mk_topic_name(__FUNCTION__, 0);
|
|
509
|
+
|
|
510
|
+
SUB_TEST_QUICK("%s, variation: %s", rd_kafka_err2name(err),
|
|
511
|
+
test_variation_name(variation));
|
|
512
|
+
|
|
513
|
+
mcluster = test_mock_cluster_new(1, &bootstraps);
|
|
514
|
+
rd_kafka_mock_set_group_consumer_heartbeat_interval_ms(mcluster, 1000);
|
|
515
|
+
rd_kafka_mock_topic_create(mcluster, topic, 1, 1);
|
|
516
|
+
|
|
517
|
+
if (variation == TEST_VARIATION_ERROR_SECOND_HB) {
|
|
518
|
+
/* First HB returns assignment */
|
|
519
|
+
rd_kafka_mock_broker_push_request_error_rtts(
|
|
520
|
+
mcluster, 1, RD_KAFKAP_ConsumerGroupHeartbeat, 1,
|
|
521
|
+
RD_KAFKA_RESP_ERR_NO_ERROR, 0);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
rd_kafka_mock_broker_push_request_error_rtts(
|
|
525
|
+
mcluster, 1, RD_KAFKAP_ConsumerGroupHeartbeat, 1, err, 0);
|
|
526
|
+
|
|
527
|
+
c = create_consumer(bootstraps, topic, rd_true);
|
|
528
|
+
|
|
529
|
+
TIMING_START(&timing, "consumer_group_heartbeat_fenced_error");
|
|
530
|
+
|
|
531
|
+
/* Subscribe to the input topic */
|
|
532
|
+
subscription = rd_kafka_topic_partition_list_new(1);
|
|
533
|
+
rd_kafka_topic_partition_list_add(subscription, topic,
|
|
534
|
+
/* The partition is ignored in
|
|
535
|
+
* rd_kafka_subscribe() */
|
|
536
|
+
RD_KAFKA_PARTITION_UA);
|
|
537
|
+
|
|
538
|
+
TEST_SAY("Subscribing to topic\n");
|
|
539
|
+
rd_kafka_mock_start_request_tracking(mcluster);
|
|
540
|
+
TEST_CALL_ERR__(rd_kafka_subscribe(c, subscription));
|
|
541
|
+
rd_kafka_topic_partition_list_destroy(subscription);
|
|
542
|
+
|
|
543
|
+
/* variation ERROR_FIRST_HB: First HB fences and second receives
|
|
544
|
+
* the assignment*/
|
|
545
|
+
expected_heartbeats = 2;
|
|
546
|
+
if (variation == TEST_VARIATION_ERROR_SECOND_HB)
|
|
547
|
+
/* variation ERROR_SECOND_HB: First HB receives assignment,
|
|
548
|
+
* second HB fences the consumer.
|
|
549
|
+
* We only await one here as we need to process the assignment
|
|
550
|
+
* callback. */
|
|
551
|
+
expected_heartbeats = 1;
|
|
552
|
+
|
|
553
|
+
TEST_SAY("Awaiting initial HBs\n");
|
|
554
|
+
TEST_ASSERT((found_heartbeats =
|
|
555
|
+
wait_all_heartbeats_done(mcluster, expected_heartbeats,
|
|
556
|
+
200)) == expected_heartbeats,
|
|
557
|
+
"Expected %d heartbeats, got %d", expected_heartbeats,
|
|
558
|
+
found_heartbeats);
|
|
559
|
+
|
|
560
|
+
expected_rebalance_cnt = 0;
|
|
561
|
+
/* variation ERROR_FIRST_HB: Second HB receives the assignment */
|
|
562
|
+
if (variation == TEST_VARIATION_ERROR_SECOND_HB) {
|
|
563
|
+
expected_rebalance_cnt++;
|
|
564
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
565
|
+
|
|
566
|
+
/* variation ERROR_SECOND_HB: first HB assigned the partitions
|
|
567
|
+
* and second one acknowledges them and receives the
|
|
568
|
+
* fencing error. */
|
|
569
|
+
rkmessage = rd_kafka_consumer_poll(c, 100);
|
|
570
|
+
TEST_ASSERT(!rkmessage, "No message should be returned");
|
|
571
|
+
TEST_ASSERT(
|
|
572
|
+
rebalance_exp_event == RD_KAFKA_RESP_ERR_NO_ERROR,
|
|
573
|
+
"Expected assign callback to be processed, but it wasn't");
|
|
574
|
+
|
|
575
|
+
TEST_ASSERT(rebalance_cnt == expected_rebalance_cnt,
|
|
576
|
+
"Expected %d rebalance events after assign "
|
|
577
|
+
"callback, got %d",
|
|
578
|
+
expected_rebalance_cnt, rebalance_cnt);
|
|
579
|
+
/* Ack is sent immediately after assignment completes. */
|
|
580
|
+
expected_heartbeats++;
|
|
581
|
+
|
|
582
|
+
TEST_SAY("Awaiting partition lost callback\n");
|
|
583
|
+
/* Second HB acks receives the fenced error
|
|
584
|
+
* and loses partitions */
|
|
585
|
+
expected_rebalance_cnt++;
|
|
586
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
587
|
+
rebalance_exp_lost = rd_true;
|
|
588
|
+
|
|
589
|
+
rkmessage = rd_kafka_consumer_poll(c, 100);
|
|
590
|
+
TEST_ASSERT(!rkmessage, "No message should be returned");
|
|
591
|
+
TEST_ASSERT(
|
|
592
|
+
rebalance_exp_event == RD_KAFKA_RESP_ERR_NO_ERROR,
|
|
593
|
+
"Expected revoke callback to be processed, but it wasn't");
|
|
594
|
+
|
|
595
|
+
TEST_ASSERT(
|
|
596
|
+
rebalance_cnt == expected_rebalance_cnt,
|
|
597
|
+
"Expected %d rebalance events after lost callback, got %d",
|
|
598
|
+
expected_rebalance_cnt, rebalance_cnt);
|
|
599
|
+
|
|
600
|
+
/* Third HB assigns the partitions again */
|
|
601
|
+
expected_heartbeats++;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
expected_rebalance_cnt++;
|
|
605
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS;
|
|
606
|
+
rebalance_exp_lost = rd_false;
|
|
607
|
+
|
|
608
|
+
TEST_SAY("Awaiting rebalance callback\n");
|
|
609
|
+
/* Consume from c, partitions are lost if assigned */
|
|
610
|
+
rkmessage = rd_kafka_consumer_poll(c, 500);
|
|
611
|
+
TEST_ASSERT(!rkmessage, "No message should be returned");
|
|
612
|
+
TEST_ASSERT(rebalance_exp_event == RD_KAFKA_RESP_ERR_NO_ERROR,
|
|
613
|
+
"Expected assign callback to be processed, but it wasn't");
|
|
614
|
+
|
|
615
|
+
TEST_ASSERT(rebalance_cnt == expected_rebalance_cnt,
|
|
616
|
+
"Expected %d total rebalance events, got %d",
|
|
617
|
+
expected_rebalance_cnt, rebalance_cnt);
|
|
618
|
+
|
|
619
|
+
/* Ack for last assignment HB */
|
|
620
|
+
expected_heartbeats++;
|
|
621
|
+
|
|
622
|
+
TEST_SAY("Awaiting acknowledge heartbeat\n");
|
|
623
|
+
TEST_ASSERT((found_heartbeats =
|
|
624
|
+
wait_all_heartbeats_done(mcluster, expected_heartbeats,
|
|
625
|
+
100)) == expected_heartbeats,
|
|
626
|
+
"Expected %d heartbeats, got %d", expected_heartbeats,
|
|
627
|
+
found_heartbeats);
|
|
628
|
+
|
|
629
|
+
expected_rebalance_cnt++;
|
|
630
|
+
rebalance_exp_event = RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS;
|
|
631
|
+
|
|
632
|
+
/* Leave group HB */
|
|
633
|
+
expected_heartbeats++;
|
|
634
|
+
/* Close c, no error is returned */
|
|
635
|
+
TEST_CALL_ERR__(rd_kafka_consumer_close(c));
|
|
636
|
+
TEST_ASSERT(rebalance_exp_event == RD_KAFKA_RESP_ERR_NO_ERROR,
|
|
637
|
+
"Expected revoke callback to be processed, but it wasn't");
|
|
638
|
+
TEST_ASSERT(rebalance_cnt == expected_rebalance_cnt,
|
|
639
|
+
"Expected %d rebalance events, got %d",
|
|
640
|
+
expected_rebalance_cnt, rebalance_cnt);
|
|
641
|
+
|
|
642
|
+
rd_kafka_destroy(c);
|
|
643
|
+
|
|
644
|
+
TEST_SAY("Verifying leave group heartbeat\n");
|
|
645
|
+
/* After closing the consumer, 1 heartbeat should been sent */
|
|
646
|
+
TEST_ASSERT((found_heartbeats =
|
|
647
|
+
wait_all_heartbeats_done(mcluster, expected_heartbeats,
|
|
648
|
+
0)) == expected_heartbeats,
|
|
649
|
+
"Expected %d heartbeats, got %d", expected_heartbeats,
|
|
650
|
+
found_heartbeats);
|
|
651
|
+
|
|
652
|
+
rd_kafka_mock_stop_request_tracking(mcluster);
|
|
653
|
+
test_mock_cluster_destroy(mcluster);
|
|
654
|
+
|
|
655
|
+
TIMING_ASSERT(&timing, 100, 1500);
|
|
656
|
+
SUB_TEST_PASS();
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* @brief Test all kind of consumer fenced errors in a ConsumerGroupHeartbeat
|
|
661
|
+
* call.
|
|
662
|
+
* @sa test_variation_t
|
|
663
|
+
*/
|
|
664
|
+
static void do_test_consumer_group_heartbeat_fenced_errors(void) {
|
|
665
|
+
rd_kafka_resp_err_t fenced_errors[] = {
|
|
666
|
+
RD_KAFKA_RESP_ERR_UNKNOWN_MEMBER_ID,
|
|
667
|
+
RD_KAFKA_RESP_ERR_FENCED_MEMBER_EPOCH};
|
|
668
|
+
size_t i;
|
|
669
|
+
test_variation_t j;
|
|
670
|
+
for (i = 0; i < RD_ARRAY_SIZE(fenced_errors); i++) {
|
|
671
|
+
for (j = TEST_VARIATION_ERROR_FIRST_HB; j < TEST_VARIATION__CNT;
|
|
672
|
+
j++)
|
|
673
|
+
do_test_consumer_group_heartbeat_fenced_error(
|
|
674
|
+
fenced_errors[i], j);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* @enum test_variation_unknown_topic_id_t
|
|
680
|
+
* @brief Variations for `do_test_metadata_unknown_topic_id_tests`.
|
|
681
|
+
*/
|
|
682
|
+
typedef enum test_variation_unknown_topic_id_t {
|
|
683
|
+
/* One topic, UNKNOWN_TOPIC_ID is given until it's not. */
|
|
684
|
+
TEST_VARIATION_UNKNOWN_TOPIC_ID_ONE_TOPIC = 0,
|
|
685
|
+
/* Two topics, first has UNKNOWN_TOPIC_ID error, second one exists. */
|
|
686
|
+
TEST_VARIATION_UNKNOWN_TOPIC_ID_TWO_TOPICS = 1,
|
|
687
|
+
TEST_VARIATION_UNKNOWN_TOPIC_ID__CNT,
|
|
688
|
+
} test_variation_unknown_topic_id_t;
|
|
689
|
+
|
|
690
|
+
static const char *
|
|
691
|
+
test_variation_unknown_topic_id_name(test_variation_t variation) {
|
|
692
|
+
switch (variation) {
|
|
693
|
+
case TEST_VARIATION_UNKNOWN_TOPIC_ID_ONE_TOPIC:
|
|
694
|
+
return "one topic";
|
|
695
|
+
case TEST_VARIATION_UNKNOWN_TOPIC_ID_TWO_TOPICS:
|
|
696
|
+
return "two topics";
|
|
697
|
+
default:
|
|
698
|
+
rd_assert(!*"Unknown test variation (unknown topic id)");
|
|
699
|
+
return NULL;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* @brief Test consumer group behavior with missing topic id when retrieving
|
|
705
|
+
* metadata for assigned topics.
|
|
706
|
+
* ensuring:
|
|
707
|
+
* - initially a partial acknoledgement is started, with an empty list
|
|
708
|
+
* (variation 0) or a single topic (variation 1)
|
|
709
|
+
* - fetch doesn't start until broker returns an unknown topic id error
|
|
710
|
+
* - when error isn't returned anymore the client finishes assigning
|
|
711
|
+
* the partition and reads a message.
|
|
712
|
+
*
|
|
713
|
+
* @param variation Test variation, see `test_variation_unknown_topic_id_t`.
|
|
714
|
+
*/
|
|
715
|
+
static void do_test_metadata_unknown_topic_id_error(
|
|
716
|
+
test_variation_unknown_topic_id_t variation) {
|
|
717
|
+
rd_kafka_mock_cluster_t *mcluster;
|
|
718
|
+
const char *bootstraps;
|
|
719
|
+
rd_kafka_topic_partition_list_t *subscription, *assignment;
|
|
720
|
+
rd_kafka_t *c;
|
|
721
|
+
test_timing_t timing;
|
|
722
|
+
const char *topic = "do_test_metadata_unknown_topic_id_error";
|
|
723
|
+
const char *topic2 = "do_test_metadata_unknown_topic_id_error2";
|
|
724
|
+
rd_kafka_topic_partition_list_t *expected_assignment;
|
|
725
|
+
|
|
726
|
+
SUB_TEST_QUICK("variation: %s",
|
|
727
|
+
test_variation_unknown_topic_id_name(variation));
|
|
728
|
+
|
|
729
|
+
expected_assignment = rd_kafka_topic_partition_list_new(1);
|
|
730
|
+
rd_kafka_topic_partition_list_add(expected_assignment, topic, 0);
|
|
731
|
+
if (variation == TEST_VARIATION_UNKNOWN_TOPIC_ID_TWO_TOPICS) {
|
|
732
|
+
rd_kafka_topic_partition_list_add(expected_assignment, topic2,
|
|
733
|
+
0);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
mcluster = test_mock_cluster_new(1, &bootstraps);
|
|
737
|
+
rd_kafka_mock_set_group_consumer_heartbeat_interval_ms(mcluster, 500);
|
|
738
|
+
rd_kafka_mock_topic_create(mcluster, topic, 1, 1);
|
|
739
|
+
if (variation == TEST_VARIATION_UNKNOWN_TOPIC_ID_TWO_TOPICS) {
|
|
740
|
+
rd_kafka_mock_topic_create(mcluster, topic2, 1, 1);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
c = create_consumer(bootstraps, topic, rd_false);
|
|
744
|
+
|
|
745
|
+
/* Seed the topic with messages */
|
|
746
|
+
test_produce_msgs_easy_v(topic, 0, 0, 0, 1, 1000, "bootstrap.servers",
|
|
747
|
+
bootstraps, NULL);
|
|
748
|
+
|
|
749
|
+
TIMING_START(&timing, "do_test_metadata_unknown_topic_id_error");
|
|
750
|
+
|
|
751
|
+
subscription = rd_kafka_topic_partition_list_new(1);
|
|
752
|
+
rd_kafka_topic_partition_list_add(subscription, topic,
|
|
753
|
+
RD_KAFKA_PARTITION_UA);
|
|
754
|
+
if (variation == TEST_VARIATION_UNKNOWN_TOPIC_ID_TWO_TOPICS) {
|
|
755
|
+
rd_kafka_topic_partition_list_add(subscription, topic2,
|
|
756
|
+
RD_KAFKA_PARTITION_UA);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
rd_kafka_mock_topic_set_error(mcluster, topic,
|
|
760
|
+
RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_ID);
|
|
761
|
+
|
|
762
|
+
TEST_SAY("Subscribing to topic\n");
|
|
763
|
+
TEST_CALL_ERR__(rd_kafka_subscribe(c, subscription));
|
|
764
|
+
rd_kafka_topic_partition_list_destroy(subscription);
|
|
765
|
+
|
|
766
|
+
TEST_SAY(
|
|
767
|
+
"Cannot fetch until Metadata calls replies with "
|
|
768
|
+
"UNKNOWN_TOPIC_ID\n");
|
|
769
|
+
test_consumer_poll_no_msgs("no messages", c, 0, 1000);
|
|
770
|
+
|
|
771
|
+
rd_kafka_mock_topic_set_error(mcluster, topic,
|
|
772
|
+
RD_KAFKA_RESP_ERR_NO_ERROR);
|
|
773
|
+
|
|
774
|
+
TEST_SAY("Reconciliation and fetch is now possible\n");
|
|
775
|
+
test_consumer_poll_timeout("message", c, 0, 0, 0, 1, NULL, 2000);
|
|
776
|
+
|
|
777
|
+
TEST_CALL_ERR__(rd_kafka_assignment(c, &assignment));
|
|
778
|
+
TEST_ASSERT(assignment != NULL);
|
|
779
|
+
TEST_ASSERT(!test_partition_list_cmp(assignment, expected_assignment),
|
|
780
|
+
"Expected assignment not seen, got %d partitions",
|
|
781
|
+
assignment->cnt);
|
|
782
|
+
rd_kafka_topic_partition_list_destroy(assignment);
|
|
783
|
+
rd_kafka_topic_partition_list_destroy(expected_assignment);
|
|
784
|
+
|
|
785
|
+
rd_kafka_destroy(c);
|
|
786
|
+
test_mock_cluster_destroy(mcluster);
|
|
787
|
+
|
|
788
|
+
TIMING_ASSERT(&timing, 500, 4000);
|
|
789
|
+
SUB_TEST_PASS();
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* @brief Test these variations of a UNKNOWN_TOPIC_ID in a Metadata call
|
|
794
|
+
* before reconciliation.
|
|
795
|
+
* @sa test_variation_unknown_topic_id_t
|
|
796
|
+
*/
|
|
797
|
+
static void do_test_metadata_unknown_topic_id_tests(void) {
|
|
798
|
+
test_variation_unknown_topic_id_t i;
|
|
799
|
+
for (i = TEST_VARIATION_UNKNOWN_TOPIC_ID_ONE_TOPIC;
|
|
800
|
+
i < TEST_VARIATION_UNKNOWN_TOPIC_ID__CNT; i++) {
|
|
801
|
+
do_test_metadata_unknown_topic_id_error(i);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
static void do_test_adherence_to_hb_interval(void) {
|
|
806
|
+
rd_kafka_mock_cluster_t *mcluster;
|
|
807
|
+
const char *bootstraps;
|
|
808
|
+
rd_kafka_topic_partition_list_t *subscription;
|
|
809
|
+
rd_kafka_t *c;
|
|
810
|
+
const char *topic =
|
|
811
|
+
test_mk_topic_name("do_test_adherence_to_hb_interval", 1);
|
|
812
|
+
rd_kafka_conf_t *conf;
|
|
813
|
+
size_t heartbeat_request_count = 0;
|
|
814
|
+
|
|
815
|
+
SUB_TEST_QUICK("do_test_adherence_to_hb_interval");
|
|
816
|
+
|
|
817
|
+
mcluster = test_mock_cluster_new(1, &bootstraps);
|
|
818
|
+
rd_kafka_mock_set_group_consumer_heartbeat_interval_ms(mcluster, 1000);
|
|
819
|
+
rd_kafka_mock_topic_create(mcluster, topic, 3, 1);
|
|
820
|
+
|
|
821
|
+
test_conf_init(&conf, NULL, 0);
|
|
822
|
+
test_conf_set(conf, "bootstrap.servers", bootstraps);
|
|
823
|
+
test_conf_set(conf, "auto.offset.reset", "earliest");
|
|
824
|
+
test_conf_set(conf, "auto.commit.interval.ms", "100");
|
|
825
|
+
c = test_create_consumer(topic, NULL, conf, NULL);
|
|
826
|
+
|
|
827
|
+
subscription = rd_kafka_topic_partition_list_new(1);
|
|
828
|
+
rd_kafka_topic_partition_list_add(subscription, topic,
|
|
829
|
+
RD_KAFKA_PARTITION_UA);
|
|
830
|
+
|
|
831
|
+
rd_kafka_mock_start_request_tracking(mcluster);
|
|
832
|
+
TEST_SAY("Subscribing to topic\n");
|
|
833
|
+
TEST_CALL_ERR__(rd_kafka_subscribe(c, subscription));
|
|
834
|
+
rd_kafka_topic_partition_list_destroy(subscription);
|
|
835
|
+
|
|
836
|
+
TEST_SAY("Subscription done, waiting for heartbeats\n");
|
|
837
|
+
|
|
838
|
+
rd_sleep(2); /* Sleep to ensure that some HB are sent */
|
|
839
|
+
|
|
840
|
+
heartbeat_request_count = test_mock_get_matching_request_cnt(
|
|
841
|
+
mcluster, is_heartbeat_request, NULL);
|
|
842
|
+
TEST_SAY("Heartbeat request count: %zu\n", heartbeat_request_count);
|
|
843
|
+
|
|
844
|
+
/* Assert that we received the expected number of heartbeats */
|
|
845
|
+
TEST_ASSERT(heartbeat_request_count >= 3 &&
|
|
846
|
+
heartbeat_request_count <= 5,
|
|
847
|
+
"Expected between 3 and 5 heartbeats, got %zu",
|
|
848
|
+
heartbeat_request_count);
|
|
849
|
+
|
|
850
|
+
rd_kafka_mock_stop_request_tracking(mcluster);
|
|
851
|
+
|
|
852
|
+
rd_kafka_destroy(c);
|
|
853
|
+
test_mock_cluster_destroy(mcluster);
|
|
854
|
+
|
|
855
|
+
SUB_TEST_PASS();
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
typedef enum do_test_quick_unsubscribe_variation_t {
|
|
859
|
+
/* No mock cluster, no coordinator available. */
|
|
860
|
+
DO_TEST_QUICK_UNSUBSCRIBE_VARIATION_NO_CLUSTER = 0,
|
|
861
|
+
/* Mock cluster is ready */
|
|
862
|
+
DO_TEST_QUICK_UNSUBSCRIBE_VARIATION_CLUSTER_READY = 1,
|
|
863
|
+
DO_TEST_QUICK_UNSUBSCRIBE_VARIATION__CNT
|
|
864
|
+
} do_test_quick_unsubscribe_variation_t;
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* @brief A series of subscribe and unsubscribe call shouldn't cause
|
|
868
|
+
* assert failures.
|
|
869
|
+
*
|
|
870
|
+
* @param variation Test variation.
|
|
871
|
+
*
|
|
872
|
+
* @sa `do_test_quick_unsubscribe_variation_t`
|
|
873
|
+
*/
|
|
874
|
+
static void
|
|
875
|
+
do_test_quick_unsubscribe(do_test_quick_unsubscribe_variation_t variation) {
|
|
876
|
+
int i;
|
|
877
|
+
rd_kafka_t *c;
|
|
878
|
+
rd_kafka_topic_partition_list_t *subscription;
|
|
879
|
+
rd_kafka_mock_cluster_t *mcluster = NULL;
|
|
880
|
+
const char *bootstraps = "localhost:9999";
|
|
881
|
+
const char *topic = test_mk_topic_name(__FUNCTION__, 0);
|
|
882
|
+
|
|
883
|
+
SUB_TEST_QUICK(
|
|
884
|
+
"%s", variation == DO_TEST_QUICK_UNSUBSCRIBE_VARIATION_NO_CLUSTER
|
|
885
|
+
? "no cluster"
|
|
886
|
+
: "mock cluster ready");
|
|
887
|
+
|
|
888
|
+
if (variation == DO_TEST_QUICK_UNSUBSCRIBE_VARIATION_NO_CLUSTER) {
|
|
889
|
+
test_curr->is_fatal_cb = error_is_fatal_cb;
|
|
890
|
+
allowed_error = RD_KAFKA_RESP_ERR__TRANSPORT;
|
|
891
|
+
} else if (variation ==
|
|
892
|
+
DO_TEST_QUICK_UNSUBSCRIBE_VARIATION_CLUSTER_READY) {
|
|
893
|
+
mcluster = test_mock_cluster_new(1, &bootstraps);
|
|
894
|
+
rd_kafka_mock_topic_create(mcluster, topic, 1, 1);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
c = create_consumer(bootstraps, topic, rd_true);
|
|
898
|
+
|
|
899
|
+
subscription = rd_kafka_topic_partition_list_new(1);
|
|
900
|
+
rd_kafka_topic_partition_list_add(subscription, topic,
|
|
901
|
+
RD_KAFKA_PARTITION_UA);
|
|
902
|
+
|
|
903
|
+
for (i = 0; i < 2; i++) {
|
|
904
|
+
TEST_CALL_ERR__(rd_kafka_subscribe(c, subscription));
|
|
905
|
+
TEST_CALL_ERR__(rd_kafka_unsubscribe(c));
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
rd_kafka_topic_partition_list_destroy(subscription);
|
|
909
|
+
rd_kafka_destroy(c);
|
|
910
|
+
RD_IF_FREE(mcluster, test_mock_cluster_destroy);
|
|
911
|
+
|
|
912
|
+
test_curr->is_fatal_cb = NULL;
|
|
913
|
+
allowed_error = RD_KAFKA_RESP_ERR_NO_ERROR;
|
|
914
|
+
SUB_TEST_PASS();
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* @brief Test all `do_test_quick_unsubscribe` variations.
|
|
919
|
+
*
|
|
920
|
+
* @sa `do_test_quick_unsubscribe_variation_t`
|
|
921
|
+
*/
|
|
922
|
+
static void do_test_quick_unsubscribe_tests(void) {
|
|
923
|
+
do_test_quick_unsubscribe_variation_t variation;
|
|
924
|
+
for (variation = DO_TEST_QUICK_UNSUBSCRIBE_VARIATION_NO_CLUSTER;
|
|
925
|
+
variation < DO_TEST_QUICK_UNSUBSCRIBE_VARIATION__CNT;
|
|
926
|
+
variation++) {
|
|
927
|
+
do_test_quick_unsubscribe(variation);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
int main_0147_consumer_group_consumer_mock(int argc, char **argv) {
|
|
932
|
+
TEST_SKIP_MOCK_CLUSTER(0);
|
|
933
|
+
|
|
934
|
+
if (test_consumer_group_protocol_classic()) {
|
|
935
|
+
TEST_SKIP("Test only for group.protocol=consumer\n");
|
|
936
|
+
return 0;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
do_test_consumer_group_heartbeat_fatal_errors();
|
|
940
|
+
|
|
941
|
+
do_test_consumer_group_heartbeat_retriable_errors();
|
|
942
|
+
|
|
943
|
+
do_test_consumer_group_heartbeat_fenced_errors();
|
|
944
|
+
|
|
945
|
+
do_test_metadata_unknown_topic_id_tests();
|
|
946
|
+
|
|
947
|
+
do_test_adherence_to_hb_interval();
|
|
948
|
+
|
|
949
|
+
do_test_quick_unsubscribe_tests();
|
|
950
|
+
|
|
951
|
+
return 0;
|
|
952
|
+
}
|