bmahler commented on a change in pull request #356: libprocess: check protobuf 
(de)serialisation success.
URL: https://github.com/apache/mesos/pull/356#discussion_r405082745
 
 

 ##########
 File path: 3rdparty/libprocess/include/process/protobuf.hpp
 ##########
 @@ -329,13 +332,11 @@ class ProtobufProcess : public process::Process<T>
   {
     google::protobuf::Arena arena;
     M* m = CHECK_NOTNULL(google::protobuf::Arena::CreateMessage<M>(&arena));
-    m->ParseFromString(data);
 
-    if (m->IsInitialized()) {
+    if (m->ParseFromString(data)) {
       (t->*method)(*m);
     } else {
-      LOG(WARNING) << "Initialization errors: "
-                   << m->InitializationErrorString();
+      LOG(WARNING) << "Error deserialising: " << data;
 
 Review comment:
   I don't think we can just dump binary data in the log message here, and 
AFAICT it looks like there isn't any information we can get from protobuf about 
why the call failed.
   
   How about just logging an ERROR level message like:
   
   > Failed to deserialize 'UpdateSlaveMessage' from slave@192.168.0.1:5050
   
   (you can just `<< to` to log the destination, and `m.GetTypeName()` for the 
name).
   
   Maybe later we could consider also logging the hex encoded message itself, 
but it might be huge.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to