From 61f203724f57b5cea71c69169374ad79bb49045d Mon Sep 17 00:00:00 2001 From: HitendraSinghRathore Date: Sun, 22 Dec 2024 00:08:41 +0530 Subject: [PATCH 1/3] Issue:#1712 fix by resetting generation id --- src/consumer/consumerGroup.js | 3 ++- src/errors.js | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/consumer/consumerGroup.js b/src/consumer/consumerGroup.js index 442312c1a..0c73d6ef9 100644 --- a/src/consumer/consumerGroup.js +++ b/src/consumer/consumerGroup.js @@ -361,8 +361,9 @@ module.exports = class ConsumerGroup { throw new KafkaJSError(e) } - if (e.type === 'UNKNOWN_MEMBER_ID') { + if (e.type === 'UNKNOWN_MEMBER_ID' || e.type === 'ILLEGAL_GENERATION') { this.memberId = null + this.groupGenerationId = null throw new KafkaJSError(e) } diff --git a/src/errors.js b/src/errors.js index 266192e19..e444bdaa3 100644 --- a/src/errors.js +++ b/src/errors.js @@ -266,9 +266,7 @@ class KafkaJSNoBrokerAvailableError extends KafkaJSError { } const isRebalancing = e => - e.type === 'REBALANCE_IN_PROGRESS' || - e.type === 'NOT_COORDINATOR_FOR_GROUP' || - e.type === 'ILLEGAL_GENERATION' + e.type === 'REBALANCE_IN_PROGRESS' || e.type === 'NOT_COORDINATOR_FOR_GROUP' const isKafkaJSError = e => e instanceof KafkaJSError From 2ddc259e33e819df547c299d628a71a69f4238aa Mon Sep 17 00:00:00 2001 From: HitendraSinghRathore Date: Sun, 22 Dec 2024 00:22:35 +0530 Subject: [PATCH 2/3] fix docker command not found issue --- scripts/dockerComposeUp.sh | 4 ++-- scripts/testWithKafka.sh | 4 ++-- scripts/waitForKafka.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/dockerComposeUp.sh b/scripts/dockerComposeUp.sh index 6407b22c0..832b168f6 100755 --- a/scripts/dockerComposeUp.sh +++ b/scripts/dockerComposeUp.sh @@ -3,7 +3,7 @@ COMPOSE_FILE=${COMPOSE_FILE:="docker-compose.2_4.yml"} echo "Running compose file: ${COMPOSE_FILE}:" -docker-compose -f "${COMPOSE_FILE}" up --force-recreate -d +docker compose -f "${COMPOSE_FILE}" up --force-recreate -d if [ -z ${NO_LOGS} ]; then - docker-compose -f "${COMPOSE_FILE}" logs -f + docker compose -f "${COMPOSE_FILE}" logs -f fi diff --git a/scripts/testWithKafka.sh b/scripts/testWithKafka.sh index e56e2dd68..6bff35793 100755 --- a/scripts/testWithKafka.sh +++ b/scripts/testWithKafka.sh @@ -16,7 +16,7 @@ find_container_id() { } quit() { - docker-compose -f "${COMPOSE_FILE}" down --remove-orphans + docker compose -f "${COMPOSE_FILE}" down --remove-orphans exit 1 } @@ -51,6 +51,6 @@ TEST_EXIT=$? echo if [ -z ${DO_NOT_STOP} ]; then - docker-compose -f "${COMPOSE_FILE}" down --remove-orphans + docker compose -f "${COMPOSE_FILE}" down --remove-orphans fi exit ${TEST_EXIT} diff --git a/scripts/waitForKafka.js b/scripts/waitForKafka.js index 1b3f4c309..0168c5efb 100755 --- a/scripts/waitForKafka.js +++ b/scripts/waitForKafka.js @@ -64,7 +64,7 @@ waitForNode(kafka3ContainerId) console.log('\nAll nodes up:') console.log( execa - .commandSync(`docker-compose -f ${process.env.COMPOSE_FILE} ps`, { shell: true }) + .commandSync(`docker compose -f ${process.env.COMPOSE_FILE} ps`, { shell: true }) .stdout.toString('utf-8') ) From 129140f6d7f566a8f593bb43aa7d6303e0a8a539 Mon Sep 17 00:00:00 2001 From: HitendraSinghRathore Date: Sun, 22 Dec 2024 09:16:37 +0530 Subject: [PATCH 3/3] azure pipeline fixes --- azure-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 831185df1..0c56e4dd1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -69,7 +69,7 @@ jobs: displayName: should skip tests - bash: test $SKIP_TESTS && echo "Skipped!" || yarn install displayName: yarn install - - bash: test $SKIP_TESTS && echo "Skipped!" || docker-compose -f ${COMPOSE_FILE} pull + - bash: test $SKIP_TESTS && echo "Skipped!" || docker compose -f ${COMPOSE_FILE} pull displayName: docker-compose pull - bash: test $SKIP_TESTS && echo "Skipped!" || yarn test:group:broker:ci displayName: test @@ -94,7 +94,7 @@ jobs: displayName: should skip tests - bash: test $SKIP_TESTS && echo "Skipped!" || yarn install displayName: yarn install - - bash: test $SKIP_TESTS && echo "Skipped!" || docker-compose -f ${COMPOSE_FILE} pull + - bash: test $SKIP_TESTS && echo "Skipped!" || docker compose -f ${COMPOSE_FILE} pull displayName: docker-compose pull - bash: test $SKIP_TESTS && echo "Skipped!" || yarn test:group:admin:ci displayName: test @@ -119,7 +119,7 @@ jobs: displayName: should skip tests - bash: test $SKIP_TESTS && echo "Skipped!" || yarn install displayName: yarn install - - bash: test $SKIP_TESTS && echo "Skipped!" || docker-compose -f ${COMPOSE_FILE} pull + - bash: test $SKIP_TESTS && echo "Skipped!" || docker compose -f ${COMPOSE_FILE} pull displayName: docker-compose pull - bash: test $SKIP_TESTS && echo "Skipped!" || yarn test:group:producer:ci displayName: test @@ -144,7 +144,7 @@ jobs: displayName: should skip tests - bash: test $SKIP_TESTS && echo "Skipped!" || yarn install displayName: yarn install - - bash: test $SKIP_TESTS && echo "Skipped!" || docker-compose -f ${COMPOSE_FILE} pull + - bash: test $SKIP_TESTS && echo "Skipped!" || docker compose -f ${COMPOSE_FILE} pull displayName: docker-compose pull - bash: test $SKIP_TESTS && echo "Skipped!" || yarn test:group:consumer:ci displayName: test @@ -171,7 +171,7 @@ jobs: displayName: should skip tests - bash: test $SKIP_TESTS && echo "Skipped!" || yarn install displayName: yarn install - - bash: test $SKIP_TESTS && echo "Skipped!" || docker-compose -f ${COMPOSE_FILE} pull + - bash: test $SKIP_TESTS && echo "Skipped!" || docker compose -f ${COMPOSE_FILE} pull displayName: docker-compose pull - bash: test $SKIP_TESTS && echo "Skipped!" || yarn test:group:others:ci displayName: test @@ -199,7 +199,7 @@ jobs: displayName: should skip tests - bash: test $SKIP_TESTS && echo "Skipped!" || yarn install displayName: yarn install - - bash: test $SKIP_TESTS && echo "Skipped!" || docker-compose -f ${COMPOSE_FILE} pull + - bash: test $SKIP_TESTS && echo "Skipped!" || docker compose -f ${COMPOSE_FILE} pull displayName: docker-compose pull - bash: test $SKIP_TESTS && echo "Skipped!" || yarn test:group:oauthbearer:ci displayName: test