Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handled UncaughtException with Consumer Runner using this.onCrash in catch #1390 #1598

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MdHusainThekiya
Copy link

by adding this catch error on this.consumerGroup.joinAndSync() in consumer/runner.js
https://github.com/tulios/kafkajs/blob/ff3b1117f316d527ae170b550bc0f772614338e9/src/consumer/runner.js#L127C49-L127C49
the following error get caught
2022-06-10T18:38:26.771Z error: uncaughtException: The coordinator is loading and hence can't process requests for this group
KafkaJSProtocolError: The coordinator is loading and hence can't process requests for this group at createErrorFromCode (/test/node_modules/kafkajs/src/protocol/error.js:581:10) at Object.parse (/test/node_modules/kafkajs/src/protocol/requests/joinGroup/v5/response.js:35:11) at Connection.send (/test/node_modules/kafkajs/src/network/connection.js:433:35) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Broker.[private:Broker:sendRequest] (/test/node_modules/kafkajs/src/broker/index.js:875:14) at async Broker.joinGroup (/test/node_modules/kafkajs/src/broker/index.js:395:14) at async ConsumerGroup.[private:ConsumerGroup:join] (/test/node_modules/kafkajs/src/consumer/consumerGroup.js:169:23) at async /test/node_modules/kafkajs/src/consumer/consumerGroup.js:335:9 at async Runner.scheduleFetchManager (/test/node_modules/kafkajs/src/consumer/runner.js:112:11)
since this code number 14 is retriable as show in below object in error.js

{
  type: 'GROUP_LOAD_IN_PROGRESS',
  code: 14,
  retriable: true,
  message: "The coordinator is loading and hence can't process requests for this group",
}

the onCrash fucntion in consumer/index.js will try to restart and it is getting handled further instead of throwing uncaught error

this will solve #1394

kindly let me know your thoughts/suggestions

@MdHusainThekiya
Copy link
Author

Hello @Nevon you have added the bug label on Jun 27, 2022 on issue #1390, kinldy review wather that will be resolved in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant