Skip to content

[BUG] NEF when get info from OSUtils #2927

@yangyichao-mango

Description

@yangyichao-mango

Describe the bug
OSUtils.cpuUsage() function will produce NumberFormatException if cpuUsage() function returns 0.0 / 0.0 = NaN.

To Reproduce
When I start my WorkerServer in my MacOS, it will schedule to produce a heartbeat signal to zk, and it will produce NFE when get cpuUsage() result equals NaN(0.0 / 0.0) from oshi.AbstractCentralProcessor#getSystemCpuLoad().

Screenshots
image

Which version of Dolphin Scheduler:
-[dev]

**Requirement or improvement

  • Use Double#isNaN() to judge the result although it returns double type, it will not throw NFE when the result is NaN(0.0 / 0.0).
  • Judge every place that use the double type in OSUtils and add Double#isNaN() judgement.
    image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions