style95 commented on a change in pull request #4459: Close the consumer when
WakeupExcpetion happened
URL:
https://github.com/apache/incubator-openwhisk/pull/4459#discussion_r281468465
##########
File path:
common/scala/src/main/scala/org/apache/openwhisk/connector/kafka/KafkaConsumerConnector.scala
##########
@@ -132,6 +132,10 @@ class KafkaConsumerConnector(
} else {
throw e
}
+ case e: WakeupException =>
+ logging.info(this, s"WakeupException happened when do commit action
for topic ${topic}")
+ close()
Review comment:
It seems this just leaves the consumer closed and there is no logic to
recreate a consumer.
Since it propagates the exception to `MessageFeed`, `MessageFeed` will keep
failing.
I think we need to 1. catch the exception here and recreate the consumer or
2. throw the exception, catch it in `MessageFeed`, and recreate the consumer.
The same approach should be taken here as well:
https://github.com/apache/incubator-openwhisk/pull/4459/files#diff-8bf7d87d98238d39ba7f36d2c52def6fR202
I am inclined to handle this exception in `KafkaConsumerConnector` layer
because the same approach is already taken here:
https://github.com/apache/incubator-openwhisk/pull/4459/files#diff-8bf7d87d98238d39ba7f36d2c52def6fR115
So in case of error, the consumer will be recreated without notifying
`MessageFeed`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services