add a constant for the time we ignore the gvl's interrupt requests

This commit is contained in:
Ben Osheroff 2015-04-28 11:06:34 -07:00
parent 784a7f3afe
commit 8857531cb7
1 changed files with 6 additions and 1 deletions

View File

@ -33,6 +33,11 @@
#include "hermann_lib.h"
/* how long to let librdkafka block on the socket before returning back to the interpreter.
* essentially defines how long we wait before consumer_consume_stop_callback() can fire */
#define CONSUMER_RECVMSG_TIMEOUT_MS 100
/**
* Convenience function
*
@ -358,7 +363,7 @@ void *consumer_recv_msg(void *ptr)
rd_kafka_message_t *ret;
HermannInstanceConfig *consumerConfig = (HermannInstanceConfig *) ptr;
ret = rd_kafka_consume(consumerConfig->rkt, consumerConfig->partition, 100);
ret = rd_kafka_consume(consumerConfig->rkt, consumerConfig->partition, CONSUMER_RECVMSG_TIMEOUT_MS);
if ( ret == NULL ) {
if ( errno != ETIMEDOUT )