From 343da45a2e922a86b577ea8276ad7b362d1d8c15 Mon Sep 17 00:00:00 2001 From: sandeep kumar Date: Wed, 20 Nov 2024 16:18:54 +0530 Subject: [PATCH 1/5] fix max call stack error --- src/protocol/requests/fetch/v4/decodeMessages.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/protocol/requests/fetch/v4/decodeMessages.js b/src/protocol/requests/fetch/v4/decodeMessages.js index abae0f515..32abc4959 100644 --- a/src/protocol/requests/fetch/v4/decodeMessages.js +++ b/src/protocol/requests/fetch/v4/decodeMessages.js @@ -25,7 +25,9 @@ const decodeMessages = async decoder => { while (messagesDecoder.canReadBytes(RECORD_BATCH_OVERHEAD)) { try { const recordBatch = await RecordBatchDecoder(messagesDecoder) - records.push(...recordBatch.records) + for(let i = 0; i < recordBatch.records.length; i++) { + records.push(recordBatch.records[i]) + } } catch (e) { // The tail of the record batches can have incomplete records // due to how maxBytes works. See https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-FetchAPI From 10509cb6e09f80a2cc34cc516fd90eb679b3dba2 Mon Sep 17 00:00:00 2001 From: sandeep kumar Date: Thu, 21 Nov 2024 11:36:20 +0530 Subject: [PATCH 2/5] lint --- src/protocol/requests/fetch/v4/decodeMessages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol/requests/fetch/v4/decodeMessages.js b/src/protocol/requests/fetch/v4/decodeMessages.js index 32abc4959..101d47ed0 100644 --- a/src/protocol/requests/fetch/v4/decodeMessages.js +++ b/src/protocol/requests/fetch/v4/decodeMessages.js @@ -25,7 +25,7 @@ const decodeMessages = async decoder => { while (messagesDecoder.canReadBytes(RECORD_BATCH_OVERHEAD)) { try { const recordBatch = await RecordBatchDecoder(messagesDecoder) - for(let i = 0; i < recordBatch.records.length; i++) { + for (let i = 0; i < recordBatch.records.length; i++) { records.push(recordBatch.records[i]) } } catch (e) { From 0f475e2aa5823e4efd3133ebd6dbccfc77248c05 Mon Sep 17 00:00:00 2001 From: sandeep kumar Date: Thu, 21 Nov 2024 11:51:11 +0530 Subject: [PATCH 3/5] update docker version --- azure-pipelines.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 831185df1..96cf22e33 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -69,8 +69,8 @@ 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 - displayName: docker-compose 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 - task: PublishTestResults@2 @@ -94,8 +94,8 @@ 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 - displayName: docker-compose 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 - task: PublishTestResults@2 @@ -119,8 +119,8 @@ 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 - displayName: docker-compose 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 - task: PublishTestResults@2 @@ -144,8 +144,8 @@ 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 - displayName: docker-compose 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 env: @@ -171,8 +171,8 @@ 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 - displayName: docker-compose 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 - task: PublishTestResults@2 @@ -199,8 +199,8 @@ 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 - displayName: docker-compose 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 - task: PublishTestResults@2 From 540bf1881df8d9b2307e290ff3e14b1fd0a0020f Mon Sep 17 00:00:00 2001 From: sandeep kumar Date: Thu, 21 Nov 2024 12:05:57 +0530 Subject: [PATCH 4/5] more docker compose updates --- scripts/dockerComposeUp.sh | 4 ++-- scripts/testWithKafka.sh | 6 +++--- scripts/waitForKafka.js | 2 +- 3 files changed, 6 insertions(+), 6 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..3560b758f 100755 --- a/scripts/testWithKafka.sh +++ b/scripts/testWithKafka.sh @@ -3,7 +3,7 @@ testCommand="$1" extraArgs="$2" -export COMPOSE_FILE=${COMPOSE_FILE:="docker-compose.2_4.yml"} +export COMPOSE_FILE=${COMPOSE_FILE:="docker compose.2_4.yml"} export KAFKAJS_DEBUG_PROTOCOL_BUFFERS=${KAFKAJS_DEBUG_PROTOCOL_BUFFERS:=1} find_container_id() { @@ -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 c28c987f1e8b9d0e107f9ade487939da9f792a6d Mon Sep 17 00:00:00 2001 From: sandeep kumar Date: Thu, 21 Nov 2024 12:29:08 +0530 Subject: [PATCH 5/5] update --- scripts/testWithKafka.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/testWithKafka.sh b/scripts/testWithKafka.sh index 3560b758f..6bff35793 100755 --- a/scripts/testWithKafka.sh +++ b/scripts/testWithKafka.sh @@ -3,7 +3,7 @@ testCommand="$1" extraArgs="$2" -export COMPOSE_FILE=${COMPOSE_FILE:="docker compose.2_4.yml"} +export COMPOSE_FILE=${COMPOSE_FILE:="docker-compose.2_4.yml"} export KAFKAJS_DEBUG_PROTOCOL_BUFFERS=${KAFKAJS_DEBUG_PROTOCOL_BUFFERS:=1} find_container_id() {