Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

ConsumerStream.prototype._read fires when this.active === false #29

@joelnet

Description

@joelnet

I have implemented a Consumer from https://github.com/confluentinc/kafka-rest-node/blob/master/examples/console_consumer.js

Occasionally I am getting a 500 error when shutting down.

20:37:50.226Z  INFO: Attempting to shut down consumer instance...
20:37:50.333Z  INFO: Consumer stream closed.
20:37:50.350Z  INFO: Consumer instance closed.
20:37:50.351Z  INFO: Consumer has shut down.
20:37:50.353Z ERROR: Consumer instance reported an error: { error_code: 500, message: 'Internal Server Error' }
20:37:50.353Z  INFO: Attempting to shut down consumer instance...

Logs from kafka-rest also show a DELETE happens, then a GET happens.

[2017-06-01 20:46:39,625] INFO 127.0.0.1 - - [01/Jun/2017:20:46:39 +0000] "DELETE /consumers/mytopic-consumer-1496349998/instances/rest-consumer-4820caa6-d67d-4588-95ff-072c251d59a3 HTTP/1.1" 204 0  14 (io.confluent.rest-utils.requests:77)
[2017-06-01 20:46:39,628] INFO 127.0.0.1 - - [01/Jun/2017:20:46:39 +0000] "GET /consumers/mytopic-consumer-1496349998/instances/rest-consumer-4820caa6-d67d-4588-95ff-072c251d59a3/topics/mytopic HTTP/1.1" 500
 52  17 (io.confluent.rest-utils.requests:77)

During debugging of ConsumerStream, I noticed _read will fire after a shutdown. this.active is set to false, but the client request is still sent which results in a 500 error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions