Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

There are a number of cases where the REST API can return infinity or NaN for certain double fields.

This is problematic because the JSON spec does not allow such values, and tooling working against that spec may run into issues when encountering such a value.

Specifically we've seen this become an issue in clients generated from the OpenAPI spec.

Public Interfaces

Any double field in the entire REST API.

  • IOMetricsInfo#accumulated-busy-time

  • ResourceProfileInfo#cpuCores/extendedResources

  • StatsSummaryDto#p*

  • SubtaskBackPressureInfo#busyRatio/idleRatio/ratio

Proposed Changes

Add a custom Jackson serializer for doubles that normalizes "odd" values to 0, ideally also logging a warning because we should treat these cases as errors.

Compatibility, Deprecation, and Migration Plan

  • What impact (if any) will there be on existing users?
  • Users should only be affected if they explicitly handled NaN/Infinity cases in a different way. This seems quite unlikely.