oleksiyk / kafka

Apache Kafka 0.9 client for Node
MIT License
297 stars 85 forks source link

Warning: a promise was created in a handler but was not returned from it #173

Closed jdconley closed 7 years ago

jdconley commented 7 years ago

I receive the following warning when starting up a group consumer in certain circumstances. no-kafka version 3.1.5.

(node:7) Warning: a promise was created in a handler at myapp/node_modules/no-kafka/lib/group_consumer.js:200:39 but was not returned from it, see http://goo.gl/rRqMUw
at Promise.then (/myapp/node_modules/bluebird/js/release/promise.js:125:17)

It looks like line 200 in group_consumer is in fact creating a promise that is not added to the chain. I'm not sure if this is desired behavior or not, since it is handled in a "tap" and I can imagine possibly not wanting to have the consumer of _fullRejoin wait on the result of the heartbeat.

If it is desired, then there should probably at least be a "catch" on it, so the promise isn't left dangling with a potential unhandled error.

Per the bluebird docs you can also return null to suppress the warning. http://goo.gl/rRqMUw