You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Matthias Pohl (Jira)" <ji...@apache.org> on 2024/01/08 17:08:00 UTC

[jira] [Assigned] (FLINK-34022) A Duration that cannot be expressed as long in nanoseconds causes an ArithmeticException in TimeUtils.formatWithHighestUnit

     [ https://issues.apache.org/jira/browse/FLINK-34022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Pohl reassigned FLINK-34022:
-------------------------------------

    Assignee: Raghav Sharma

> A Duration that cannot be expressed as long in nanoseconds causes an ArithmeticException in TimeUtils.formatWithHighestUnit
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-34022
>                 URL: https://issues.apache.org/jira/browse/FLINK-34022
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Configuration
>    Affects Versions: 1.18.0, 1.17.2, 1.19.0
>            Reporter: Matthias Pohl
>            Assignee: Raghav Sharma
>            Priority: Major
>              Labels: starter
>
> The following code fails with an {{ArithmeticException}} because of the actual timeframe not being able to be converted into a long value:
> {code:java}
> TimeUtils.formatWithHighestUnit(Duration.ofMillis(Long.MAX_VALUE));
> {code}
> This method is used to pretty-print Duration values and most often used with configuration values. We might want to have a reasonable fallback instead of throwing a {{RuntimeException}} here.
> E.g. it can cause the error in the [ClusterConfigHandler|https://github.com/apache/flink/blob/ebdde651edae8db6b2ac740f07d97124dc01fea4/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/cluster/ClusterConfigHandler.java#L56] if a Duration-based configuration parameter is set too high (e.g. [JobManagerOptions.RESOURCE_WAIT_TIMEOUT|https://github.com/apache/flink/blob/3ff225c5f993282d6dfc7726fc08cc00058d9a7f/flink-core/src/main/java/org/apache/flink/configuration/JobManagerOptions.java#L540]).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)