Skip to content

Conversation

@keviningvalson
Copy link

ProcessStatisticsResource is inconsistent with possible responses from https://v3-apidocs.cloudfoundry.org/version/3.87.0/index.html#the-process-stats-object for processes in a DOWN state

https://github.com/cloudfoundry/cli/blob/master/api/cloudcontroller/ccv3/process_instance.go was referenced for another clients perspective into the data types.

Observed values generating errors

Cannot construct instance of `org.cloudfoundry.client.v3.processes.ProcessStatisticsResource`, problem: Cannot build ProcessStatisticsResource, some of required attributes are not set [diskQuota, fileDescriptorQuota, host, memoryQuota, usage]
 at [Source: (byte[])"{
  "resources": [
    {
      "type": "web",
      "index": 0,
      "state": "DOWN",
      "uptime": 0,
      "isolation_segment": null,
      "details": null
    }
  ]
}"; line: 10, column: 5] (through reference chain: org.cloudfoundry.client.v3.applications.GetApplicationProcessStatisticsResponse$Json["resources"]->java.util.ArrayList[0])
Ignoring Numeric value (2147483648) out of range of int (-2147483648 - 2147483647)
 at [Source: (byte[])"{
  "resources": [
    {
      "type": "web",
      "index": 0,
      "state": "RUNNING",
      "usage": {
        "time": "2020-08-18T18:59:07+00:00",
        "cpu": 0.005116455439914927,
        "mem": 656569895,
        "disk": 191660032
      },
      "host": "10.10.1.3",
      "uptime": 87662,
      "mem_quota": 2147483648,
      "disk_quota": 536870912,
      "fds_quota": 16384,
      "isolation_segment": null,
      "details": null,
      "instance_ports": [
        {
          "extern"[truncated 790 bytes]; line: 15, column: 30] (through reference chain: org.cloudfoundry.client.v3.applications.GetApplicationProcessStatisticsResponse$Json["resources"]->java.util.Arra
yList[0]->org.cloudfoundry.client.v3.processes.ProcessStatisticsResource$Json["mem_quota"])

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 19, 2020

CLA Check
The committers are authorized under a signed CLA.

@keviningvalson keviningvalson changed the title Process statistics data types fixes cf-java-client/issues/1062 Process statistics data types fixes cf-java-client/issues/1062 and cf-java-client/issues/1063 Sep 20, 2020
@dmikusa dmikusa added bug client triaged Initial triage of issue has been performed labels Jun 4, 2021
dmikusa pushed a commit that referenced this pull request Jun 4, 2021
This is a follow up to PR #1085 and was pointed out in PR #1064.
dmikusa pushed a commit that referenced this pull request Jun 4, 2021
A ProcessStatisticsResource in state DOWN should not have properties diskQuota, fileDescriptorQuota, host, memoryQuota, usage set.
A ProcessStatisticsResource in state RUNNING, CRASHED, STARTING should have these properties set.

Part of this fix comes from @keviningvalson & PR #1064. Resolves #1062.
@dmikusa
Copy link
Contributor

dmikusa commented Jun 4, 2021

Part of this issue was resolved with a different PR, #1085. I manually merged in the part you have resolving the issue with DOWN state & missing properties. I also added some logic to still perform validation for other states. See 28dea4f.

@dmikusa dmikusa closed this Jun 4, 2021
dmikusa pushed a commit that referenced this pull request Aug 20, 2021
This is a follow up to PR #1085 and was pointed out in PR #1064.
dmikusa pushed a commit that referenced this pull request Aug 20, 2021
A ProcessStatisticsResource in state DOWN should not have properties diskQuota, fileDescriptorQuota, host, memoryQuota, usage set.
A ProcessStatisticsResource in state RUNNING, CRASHED, STARTING should have these properties set.

Part of this fix comes from @keviningvalson & PR #1064. Resolves #1062.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug client triaged Initial triage of issue has been performed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants