sven-lange-last commented on a change in pull request #2878: Streamingly read 
user-logs.
URL: 
https://github.com/apache/incubator-openwhisk/pull/2878#discussion_r152984093
 
 

 ##########
 File path: 
core/invoker/src/main/scala/whisk/core/containerpool/docker/DockerContainer.scala
 ##########
 @@ -236,7 +236,7 @@ class DockerContainer(protected val id: ContainerId,
   def logs(limit: ByteSize, waitForSentinel: Boolean)(implicit transid: 
TransactionId): Source[ByteString, Any] = {
     docker
       .rawContainerLogs(id, logFileOffset.get(), if (waitForSentinel) 
Some(filePollInterval) else None)
-      .via(Framing.delimiter(delimiter, Int.MaxValue))
+      .via(Framing.delimiter(delimiter, limit.toBytes.toInt))
 
 Review comment:
   Should add a comment here that we can obtain a FramingException for two 
reasons:
   1. the Source provides an incomplete line so that the delimiter cannot be 
found.
   2. the Source provides more data than `limit.toBytes.toInt` which is 
effectively a truncation due to limit exceeded.
   
   As a result we cannot decide in later stages whether we should issue a `log 
processing problem` or a `log truncated` message.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to