[jira] [Commented] (MESOS-4582) state.json serving duplicate "active" fields

2016-02-16 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-4582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15149502#comment-15149502
 ] 

Michael Park commented on MESOS-4582:
-

{noformat}
commit 195464c3f1f82b977d765218471350ac9bc5d2f8
Author: Michael Park 
Date:   Tue Feb 16 15:02:16 2016 -0800

Removed the duplicate "active" field in json schema of `Framework`.

The new `jsonify` library is a writer-based approach, and does not keep
track of the fields that have been written out so far. The previous
version of `summarize(framework)` and `model(framework)` had a duplicate
`"active"` field which was de-duplicated since they simply get inserted
to a `std::map`, overriding the previous value.

In the `jsonify` case, this pattern results in duplicate key in the JSON
output. Although the presence of duplicate keys is technically not
__invalid__ according to the JSON specification, some JSON libraries
disallow them. As such, we should generate JSON outputs without
duplicate keys.

Review: https://reviews.apache.org/r/43159/
{noformat}

> state.json serving duplicate "active" fields
> 
>
> Key: MESOS-4582
> URL: https://issues.apache.org/jira/browse/MESOS-4582
> Project: Mesos
>  Issue Type: Bug
>Affects Versions: 0.27.0
>Reporter: Michael Gummelt
>Assignee: Michael Park
>Priority: Blocker
> Fix For: 0.27.1
>
> Attachments: error.json
>
>
> state.json is serving duplicate "active" fields in frameworks.  See the 
> framework "47df96c2-3f85-4bc5-b781-709b2c30c752-" In the attached file



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-4582) state.json serving duplicate "active" fields

2016-02-09 Thread Stavros Kontopoulos (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-4582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15139673#comment-15139673
 ] 

Stavros Kontopoulos commented on MESOS-4582:


There is a discussion here: 
http://stackoverflow.com/questions/21832701/does-json-syntax-allow-duplicate-keys-in-an-object
 which is helpful i think... check second answer...


> state.json serving duplicate "active" fields
> 
>
> Key: MESOS-4582
> URL: https://issues.apache.org/jira/browse/MESOS-4582
> Project: Mesos
>  Issue Type: Bug
>Affects Versions: 0.27.0
>Reporter: Michael Gummelt
>Assignee: Michael Park
>Priority: Blocker
> Attachments: error.json
>
>
> state.json is serving duplicate "active" fields in frameworks.  See the 
> framework "47df96c2-3f85-4bc5-b781-709b2c30c752-" In the attached file



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-4582) state.json serving duplicate "active" fields

2016-02-06 Thread Marco Massenzio (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-4582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15136137#comment-15136137
 ] 

Marco Massenzio commented on MESOS-4582:


Sounds good to me!
I'd suggest to document the behavior someplace with a reference to the 
appropriate standard document, so that people won't make the same mistake I did.

> state.json serving duplicate "active" fields
> 
>
> Key: MESOS-4582
> URL: https://issues.apache.org/jira/browse/MESOS-4582
> Project: Mesos
>  Issue Type: Bug
>Affects Versions: 0.27.0
>Reporter: Michael Gummelt
>Assignee: Michael Park
>Priority: Blocker
> Attachments: error.json
>
>
> state.json is serving duplicate "active" fields in frameworks.  See the 
> framework "47df96c2-3f85-4bc5-b781-709b2c30c752-" In the attached file



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-4582) state.json serving duplicate "active" fields

2016-02-05 Thread Marco Massenzio (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-4582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15135137#comment-15135137
 ] 

Marco Massenzio commented on MESOS-4582:


I'm almost sure that duplicate keys are not legal JSON - worth checking the 
standard, but I'd be in favor of keepin the checks and throwing back a 406 (Bad 
Request).

If you want, I can look it up later this weekend and find out what the JSON 
standard says?

Thanks for fixing it!

> state.json serving duplicate "active" fields
> 
>
> Key: MESOS-4582
> URL: https://issues.apache.org/jira/browse/MESOS-4582
> Project: Mesos
>  Issue Type: Bug
>Affects Versions: 0.27.0
>Reporter: Michael Gummelt
>Assignee: Michael Park
>Priority: Blocker
> Attachments: error.json
>
>
> state.json is serving duplicate "active" fields in frameworks.  See the 
> framework "47df96c2-3f85-4bc5-b781-709b2c30c752-" In the attached file



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-4582) state.json serving duplicate "active" fields

2016-02-05 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-4582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15135228#comment-15135228
 ] 

Michael Park commented on MESOS-4582:
-

[~marco-mesos] I've already looked it up, and the presence of duplicate keys is 
valid JSON. Many JSON libraries (Go, Python, C#, etc) simply use the last 
instance of the duplicate keys. Those same libraries make it hard (impossible?) 
to generate a JSON with duplicate keys. My proposal here is to take the same 
approach where we are tolerant of input with duplicate keys, but don't generate 
JSON with duplicate keys in our output.

> state.json serving duplicate "active" fields
> 
>
> Key: MESOS-4582
> URL: https://issues.apache.org/jira/browse/MESOS-4582
> Project: Mesos
>  Issue Type: Bug
>Affects Versions: 0.27.0
>Reporter: Michael Gummelt
>Assignee: Michael Park
>Priority: Blocker
> Attachments: error.json
>
>
> state.json is serving duplicate "active" fields in frameworks.  See the 
> framework "47df96c2-3f85-4bc5-b781-709b2c30c752-" In the attached file



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-4582) state.json serving duplicate "active" fields

2016-02-04 Thread Michael Park (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-4582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15133495#comment-15133495
 ] 

Michael Park commented on MESOS-4582:
-

If a user, perhaps a script was passing us a JSON input with duplicate keys via 
an HTTP endpoint, disallowing duplicate keys in {{JSON::parse}} would break 
them. As such, I've discarded the patches to disallow duplicate keys in 
{{JSON::parse}}. I think we should continue to be accepting on user input and 
constrain our output to work for any JSON library.

> state.json serving duplicate "active" fields
> 
>
> Key: MESOS-4582
> URL: https://issues.apache.org/jira/browse/MESOS-4582
> Project: Mesos
>  Issue Type: Bug
>Affects Versions: 0.27.0
>Reporter: Michael Gummelt
>Assignee: Michael Park
>Priority: Blocker
> Attachments: error.json
>
>
> state.json is serving duplicate "active" fields in frameworks.  See the 
> framework "47df96c2-3f85-4bc5-b781-709b2c30c752-" In the attached file



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)