bmahler commented on a change in pull request #356: libprocess: check protobuf (de)serialisation success. URL: https://github.com/apache/mesos/pull/356#discussion_r405086348
########## File path: 3rdparty/libprocess/include/process/protobuf.hpp ########## @@ -39,8 +39,11 @@ inline void post(const process::UPID& to, const google::protobuf::Message& message) { std::string data; - message.SerializeToString(&data); - post(to, message.GetTypeName(), data.data(), data.size()); + if (message.SerializeToString(&data)) { + post(to, message.GetTypeName(), data.data(), data.size()); + } else { + LOG(WARNING) << "Error serialising: " << message.DebugString(); Review comment: I don't think we can log the message here since it may be huge (e.g. 2GB), how about an ERROR level message like: > Failed to post 'UpdateSlaveMessage' to slave@192.168.0.1:5050: Failed to serialize (you can just `<< to` to log the destination, and `m.GetTypeName()` for the name). ---------------------------------------------------------------- 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