mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Qian Zhang <>
Subject Re: Review Request 61109: Fixed JSON protobuf deserialization to ignore unrecognized enum values.
Date Mon, 02 Oct 2017 15:12:57 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated Oct. 2, 2017, 11:12 p.m.)

Review request for mesos, Benjamin Mahler and James Peach.


Addressed review comments.

Summary (updated)

Fixed JSON protobuf deserialization to ignore unrecognized enum values.

Bugs: MESOS-7828

Repository: mesos

Description (updated)

Protobuf deserialization will discard any unrecognized enum values.
This patch fixes our custom JSON -> protobuf conversion code to be
consistent with this behavior.

See MESOS-4997 for why this matters when dealing with upgrades.

Fixes MESOS-7828.

Diffs (updated)

  3rdparty/stout/include/stout/protobuf.hpp 15690b66cc4ae0c1bf2c2176d73c385ca75d3c20 




With this patch, when accessing master endpoint with an inexistent enum `xxx` in a JSON:
curl -X POST -H "Content-Type: application/json" -d '{"type": "xxx"}'
The master log will be:
I0725 23:09:53.097790   665 http.cpp:1133] HTTP POST for /master/api/v1 from
with User-Agent='curl/7.47.0'
I0725 23:09:53.098006   665 http.cpp:669] Processing call UNKNOWN
This proves when parsing an inexistent enum the default enum value (i.e., `UNKNOWN`) will
be used.


Qian Zhang

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message