You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by gi...@git.apache.org on 2017/05/23 20:00:54 UTC

[GitHub] bjustin-ibm commented on a change in pull request #174: Ensure trigger payload is within specified size limit

bjustin-ibm commented on a change in pull request #174: Ensure trigger payload is within specified size limit
URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/174#discussion_r118091636
 
 

 ##########
 File path: provider/consumer.py
 ##########
 @@ -278,8 +287,20 @@ def __pollForMessages(self):
                 if (message is not None):
                     if not message.error():
                         logging.debug("Consumed message: {}".format(str(message)))
-                        messageSize += len(message.value())
-                        messages.append(message)
+                        messageSize = self.__sizeMessage(message)
+                        if totalPayloadSize + messageSize > payload_limit:
+                            if len(messages) == 0:
+                                logging.error('[{}] Single message at offset {} exceeds payload size limit. Skipping this message!'.format(self.trigger, message.offset()))
 
 Review comment:
   We don't currently have a nice mechanism for this. We are toying with the idea of exposing the trigger health info to the user or, even logs related to their triggers. That will be handled separately along with info related to automatic trigger disablement/deletion.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services