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

Consumer for >= 1.13 crashes on some topic names #994

Closed
asmeikal opened this issue Dec 30, 2020 · 0 comments · Fixed by #995
Closed

Consumer for >= 1.13 crashes on some topic names #994

asmeikal opened this issue Dec 30, 2020 · 0 comments · Fixed by #995

Comments

@asmeikal
Copy link
Contributor

Describe the bug
I upgraded kafkajs to 1.15 from 1.12 and found a consumer was crashing with

TypeError: assignment[assignee][topicPartition.topic].push is not a function

After digging a little deeper, the problem was caused by having a topic called shift. What happens is that here an array is created (instead of an object), and the builtin shift method is mistaken for that topic's assignment.

To Reproduce

Call assign with a topic named shift, or any other array builtin method.

Expected behavior

This should not crash, I should be able to call my topics shift or even __proto__.

Observed behavior

The consumer crashes at startup.

Environment:

  • OS: Arch Linux
  • KafkaJS version: 1.15
  • Kafka version: not sure, shouldn't be relevant
  • NodeJS version: 12.20

I'm opening a PR with a fix.

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 a pull request may close this issue.

1 participant