[
https://issues.apache.org/jira/browse/MESOS-5567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15320705#comment-15320705
]
Tobias Mueller commented on MESOS-5567:
---------------------------------------
Thanks for the fast reply. That's what I think as well, strange thing is that
this occurs maybe in 2% of the events I'm seeing. The other 98% are "one JSON
per line" events.
Maybe it'd make sense to revise the docs at "RecordIO response format" a
little, because I'm not seeing the line lengths as described, only the overall
length at the beginning. Furthermore, when I receive a chunked JSON, there is
no \n at the end of the chunk.
Excerpt:
{noformat}
128\n
{"type": "SUBSCRIBED","subscribed": {"framework_id":
{"value":"12220-3440-12532-2345"},...}104\n
{"framework_id": {"value": "12220-3440-12532-2345"},...{"value" :
"12220-3440-12532-O12"},}208\n
...
{noformat}
> Scheduler HTTP API cuts JSON buffers
> ------------------------------------
>
> Key: MESOS-5567
> URL: https://issues.apache.org/jira/browse/MESOS-5567
> Project: Mesos
> Issue Type: Bug
> Components: HTTP API
> Affects Versions: 0.28.1
> Environment: Ubuntu 14.04 latest
> Reporter: Tobias Mueller
>
> According to the docs at
> http://mesos.apache.org/documentation/latest/scheduler-http-api/ I assumed
> that the message format would only contain "full" (meaning parseable) JSON
> messages. In fact, I'm partially seeing splitted JSONs, where the next chunk
> is just continuing the first part:
> {noformat}
> 1983
> {"offers":{"offers":[{"agent_id":{"value":"2a0fb93e-6125-4bcd-b19a-0be41b9d7bbe-S0"},"framework_id":{"value":"f7c62096-7fd3-446b-98df-14c991dc4f7e-0020"},"hostname":"172.17.10.102","id":{"value":"f7c62096-7fd3-446b-98df-14c991dc4f7e-O1055"},"resources":[{"name":"cpus","role":"*","scalar":{"value":2.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":1985.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":35164.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"172.17.10.102","ip":"172.17.10.102","port":5051},"path":"\/slave(1)","scheme":"http"}},{"agent_id":{"value":"2a0fb93e-6125-4bcd-b19a-0be41b9d7bbe-S2"},"framework_id":{"value":"f7c62096-7fd3-446b-98df-14c991dc4f7e-0020"},"hostname":"172.17.10.101","id":{"value":"f7c62096-7fd3-446b-98df-14c991dc4f7e-O1056"},"resources":[{"name":"cpus","role":"*","scalar":{"value":2.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":1985.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":35164.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"172.17.10.101","ip":"172.17.10.101","port":5051},"path":"\/slave(1)","scheme":"http"}},{"agent_id":{"value":"2a0fb93e-6125-4bcd-b19a-0be41b9d7bbe-S1"},"framework_id":{"value":"f7c62096-7fd3-446b-98df-14c991dc
> 4f7e-0020"},"hostname":"172.17.10.103","id":{"value":"f7c62096-7fd3-446b-98df-14c991dc4f7e-O1057"},"resources":[{"name":"cpus","role":"*","scalar":{"value":2.0},"type":"SCALAR"},{"name":"mem","role":"*","scalar":{"value":1985.0},"type":"SCALAR"},{"name":"disk","role":"*","scalar":{"value":35164.0},"type":"SCALAR"},{"name":"ports","ranges":{"range":[{"begin":31000,"end":32000}]},"role":"*","type":"RANGES"}],"url":{"address":{"hostname":"172.17.10.103","ip":"172.17.10.103","port":5051},"path":"\/slave(1)","scheme":"http"}}]},"type":"OFFERS"}
> {noformat}
> I use the standard Node.js (4.4.5) http-client.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)