Skip to content

NumberFormatException occured during CICD staging in one of the typefox yang_lsp library method checkRevisionOrder #250

Description

@sravaniregalla

Hi Team.

We have CICD staging, where several micro services are tested end-to -end.
In such scenario, we have encountered an exception from typefox yang-lsp library.

The stacktrace is attached below:

25-02-22 16:23:40.505 ERROR CompositeEValidator:155 - Error executing EValidator
java.lang.NumberFormatException: For input string: ".111E111E22"
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.base/java.lang.Double.parseDouble(Double.java:651)
at java.base/java.text.DigitList.getDouble(DigitList.java:169)
at java.base/java.text.DecimalFormat.parse(DecimalFormat.java:2202)
at java.base/java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1937)
at java.base/java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1545)
at java.base/java.text.DateFormat.parse(DateFormat.java:397)
at io.typefox.yang.utils.YangDateUtils$1$1.getTimeSafe(YangDateUtils.java:80)
at io.typefox.yang.utils.YangDateUtils$1$1.compare(YangDateUtils.java:67)
at io.typefox.yang.utils.YangDateUtils$1$1.compare(YangDateUtils.java:64)
at io.typefox.yang.utils.YangDateUtils.isGreaterThan(YangDateUtils.java:101)
at io.typefox.yang.validation.YangValidator.checkRevisionOrder(YangValidator.java:511)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

The issue was coming from one of the methods in typefox 3pp library (checkRevisionOrder). This is in turn using a java library SimpleDateFormat.
After research, I came to know that the issue exists in the library itself.
SimpleDateFormat is not thread safe, and we’re referencing it from multiple threads. Refer to the similar issue [here].(https://stackoverflow.com/questions/21017502/numberformatexception-while-parsing-date-with-simpledateformat-parse)

The actual issue was reported form CICD staging, where multiple service executions were done in parallel.

Kindly resolve this issue.

Thanks
//Sravani Regalla

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions