mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Budnik <abud...@mesosphere.com>
Subject Re: Review Request 72162: Accommodated the "Infinity" value in the JSON <-> Protobuf conversion.
Date Mon, 02 Mar 2020 11:49:18 GMT


> On Фев. 25, 2020, 5:23 п.п., Andrei Budnik wrote:
> > 3rdparty/stout/include/stout/protobuf.hpp
> > Lines 551 (patched)
> > <https://reviews.apache.org/r/72162/diff/1/?file=2212015#file2212015line551>
> >
> >     It looks like `JSON::parse()` alone can't parse infinite values from a json
string that has been serialized by `jsonify()`. If so, can it cause any issues? Do we want
a test for such a case?
> >     
> >     What prevents us from parsing infinite values in `JSON::parse()`?
> 
> Greg Mann wrote:
>     Sorry could you clarify - does your first question imply that `jsonify()` serializes
infinity values into a format different than the string in the unit test in this patch?
>     
>     Regarding your second question, I think that the updates to the rapid json writers
enable JSON::parse() to handle infinite values, don't they? The new test case parses "Infinity"
etc. using `JSON::parse()`.
> 
> Qian Zhang wrote:
>     Andrei, I do not follow your questions too, could you please elaborate?

If a `JSON::parse<JSON::Number>()` could parse `Infinity` values, we wouldn't need to
modify this `operator()`. A `JSON::parse` function specialization for `JSON::Number` type
could return `std::numeric_limits<double>::infinity()` if the argument equals to `"Infinity"`.

However, some call sites of the `parse` function may find the new behavior unacceptable as
we're trying to extend JSON by adding non-standard special values for infinities. Thus, I'm
dropping this comment.


- Andrei


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72162/#review219657
-----------------------------------------------------------


On Март 2, 2020, 6:31 д.п., Qian Zhang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72162/
> -----------------------------------------------------------
> 
> (Updated Март 2, 2020, 6:31 д.п.)
> 
> 
> Review request for mesos, Andrei Budnik, Andrei Sekretenko, Benjamin Mahler, and Greg
Mann.
> 
> 
> Bugs: MESOS-10064
>     https://issues.apache.org/jira/browse/MESOS-10064
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Accommodated the "Infinity" value in the JSON <-> Protobuf conversion.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/jsonify.hpp 7a239d846de5679e9c2b80aa4e617a72fdeac92c 
>   3rdparty/stout/include/stout/protobuf.hpp fcd91d5ea822612e4b32d157fcbc5f0dedeba823

>   3rdparty/stout/tests/protobuf_tests.cpp 55889dc432a9459965d3dd75052d672828cdea90 
>   3rdparty/stout/tests/protobuf_tests.proto 5e20215fcc69e400358847d0ce943d8c18f2a9e0

> 
> 
> Diff: https://reviews.apache.org/r/72162/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Qian Zhang
> 
>


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