[ https://issues.apache.org/jira/browse/MESOS-4754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15162684#comment-15162684 ]
Michael Park edited comment on MESOS-4754 at 2/24/16 10:07 AM: --------------------------------------------------------------- The issue here is that even though {{src/common/http.cpp}} has a definition of {{void json(JSON::ObjectWriter* writer, const ExecutorInfo& executorInfo);}}, its declaration is missing from {{src/common/http.hpp}}. We would have liked this to cause a compiler error, but it didn't because of the generic {{json}} function for protobuf messages: {{inline void json(ObjectWriter* writer, const google::protobuf::Message& message)}}, which can jsonify {{ExecutorInfo}} using the protobuf schema. The resolution will be the following: 1. Add the missing declaration of {{void json(JSON::ObjectWriter* writer, const ExecutorInfo& executorInfo);}} to {{src/common/http.hpp}} 2. Make the generic {{json}} function that handles protobuf messages to required explicit opt-in. {code} - writer->field("cgroup_info", status.cgroup_info()); + writer->field("cgroup_info", JSON::Protobuf(status.cgroup_info())); {code} was (Author: mcypark): The issue here is that even though {{src/common/http.cpp}} has a definition of {{void json(JSON::ObjectWriter* writer, const ExecutorInfo& executorInfo);}}, its declaration is missing from {{src/common/http.hpp}}. This should have caused a compiler error, but it did not because we provide a generic {{json}} function for protobuf messages: {{inline void json(ObjectWriter* writer, const google::protobuf::Message& message)}}, which can jsonify {{ExecutorInfo}} using the protobuf schema. The resolution will be the following: 1. Add the missing declaration of {{void json(JSON::ObjectWriter* writer, const ExecutorInfo& executorInfo);}} to {{src/common/http.hpp}} 2. Make the generic {{json}} function that handles protobuf messages to required explicit opt-in. {code} - writer->field("cgroup_info", status.cgroup_info()); + writer->field("cgroup_info", JSON::Protobuf(status.cgroup_info())); {code} > The "executors" field is exposed under a backwards incompatible schema. > ----------------------------------------------------------------------- > > Key: MESOS-4754 > URL: https://issues.apache.org/jira/browse/MESOS-4754 > Project: Mesos > Issue Type: Bug > Components: master > Reporter: Michael Park > Assignee: Michael Park > Labels: mesosphere > Fix For: 0.27.2 > > > In 0.26.0, the master's {{/state}} endpoint generated the following: > {code} > { > /* ... */ > "frameworks": [ > { > /* ... */ > "executors": [ > { > "command": { > "argv": [], > "uris": [], > "value": > "/Users/mpark/Projects/mesos/build/opt/src/long-lived-executor" > }, > "executor_id": "default", > "framework_id": "0ea528a9-64ba-417f-98ea-9c4b8d418db6-0000", > "name": "Long Lived Executor (C++)", > "resources": { > "cpus": 0, > "disk": 0, > "mem": 0 > }, > "slave_id": "8a513678-03a1-4cb5-9279-c3c0c591f1d8-S0" > } > ], > /* ... */ > } > ] > /* ... */ > } > {code} > In 0.27.1, the {{ExecutorInfo}} is mistakenly exposed in the raw protobuf > schema: > {code} > { > /* ... */ > "frameworks": [ > { > /* ... */ > "executors": [ > { > "command": { > "shell": true, > "value": > "/Users/mpark/Projects/mesos/build/opt/src/long-lived-executor" > }, > "executor_id": { > "value": "default" > }, > "framework_id": { > "value": "368a5a49-480b-41f6-a13b-24a69c92a72e-0000" > }, > "name": "Long Lived Executor (C++)", > "slave_id": "8a513678-03a1-4cb5-9279-c3c0c591f1d8-S0", > "source": "cpp_long_lived_framework" > } > ], > /* ... */ > } > ] > /* ... */ > } > {code} > This is a backwards incompatible API change. -- This message was sent by Atlassian JIRA (v6.3.4#6332)