You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Dominic Hamon (JIRA)" <ji...@apache.org> on 2014/12/09 23:39:13 UTC

[jira] [Commented] (MESOS-2185) slave state endpoint does not contain all resources in the resources field

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

Dominic Hamon commented on MESOS-2185:
--------------------------------------

from {{src/common/http.cpp}}

{code}
40 JSON::Object model(const Resources& resources)
 41 {
 42   JSON::Object object;
 43   object.values["cpus"] = 0;
 44   object.values["mem"] = 0;
 45   object.values["disk"] = 0;
 46
 47   const Option<double>& cpus = resources.cpus();
 48   if (cpus.isSome()) {
 49     object.values["cpus"] = cpus.get();
 50   }
 51
 52   const Option<Bytes>& mem = resources.mem();
 53   if (mem.isSome()) {
 54     object.values["mem"] = mem.get().megabytes();
 55   }
 56
 57   const Option<Bytes>& disk = resources.disk();
 58   if (disk.isSome()) {
 59     object.values["disk"] = disk.get().megabytes();
 60   }
 61
 62   const Option<Value::Ranges>& ports = resources.ports();
 63   if (ports.isSome()) {
 64     object.values["ports"] = stringify(ports.get());
 65   }
 66
 67   return object;
 68 }
{code}


so yes, we deliberately only report "known" resources in the state endpoint. I'm not sure if anyone relies on this behaviour...

> slave state endpoint does not contain all resources in the resources field
> --------------------------------------------------------------------------
>
>                 Key: MESOS-2185
>                 URL: https://issues.apache.org/jira/browse/MESOS-2185
>             Project: Mesos
>          Issue Type: Bug
>          Components: json api, slave
>    Affects Versions: 0.21.0
>         Environment: Centos 6.5 / Centos 6.6
>            Reporter: Henning Schmiedehausen
>
> fetching status for a slave from the /state.json yields
>   "resources": {
>     "ports": "[31000-32000]",
>     "mem": 512,
>     "disk": 33659,
>     "cpus": 1
>   }
> but in the flags section, it lists
> "flags": {
>    "resources": "cpus:1;mem:512;ports:[31000-32000];set:{label_a,label_b,label_c,label_d};range:[0-1000];scalar:108;numbers:{4,8,15,16,23,42}",
> }
> so there are additional resources. these resources show up when sending offers from that slave to the frameworks and the frameworks can use and consume them.
> This may just be a reporting issue with the state.json endpoint.
> https://gist.github.com/hgschmie/0dc4f599bb0ff2e815ed is the full response.



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