You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The javadoc for SimpleDateFormat will confirm: this class isn’t thread safe. Internally, it mutates several mutable fields in the process of parsing and formatting. Accessing instances of SimpleDateFormat from multiple threads concurrently (to perform either operation) can lead to either unexpected “impossible“ exceptions or silently corrupt results.
To fix this issue, the following usages (at least, I only looked through 1.3.8 not master to find these) need to be modified to either put the SimpleDateFormat inside of a ThreadLocal, create each SimpleDateFormat instance per usage, or use JDK 8’s DateTimeFormatter which is immutable and thread safe:
The javadoc for SimpleDateFormat will confirm: this class isn’t thread safe. Internally, it mutates several mutable fields in the process of parsing and formatting. Accessing instances of SimpleDateFormat from multiple threads concurrently (to perform either operation) can lead to either unexpected “impossible“ exceptions or silently corrupt results.
To fix this issue, the following usages (at least, I only looked through 1.3.8 not master to find these) need to be modified to either put the SimpleDateFormat inside of a ThreadLocal, create each SimpleDateFormat instance per usage, or use JDK 8’s DateTimeFormatter which is immutable and thread safe:
Hive-JSON-Serde/json-serde-cdh5-shim/src/main/java/org/openx/data/jsonserde/objectinspector/primitive/JavaStringDateObjectInspector.java
Line 16 in 8d5c1bf
Hive-JSON-Serde/json-serde/src/main/java/org/openx/data/jsonserde/objectinspector/primitive/ParsePrimitiveUtils.java
Line 28 in 8d5c1bf
Hive-JSON-Serde/json-serde/src/main/java/org/openx/data/jsonserde/objectinspector/primitive/ParsePrimitiveUtils.java
Line 29 in 8d5c1bf
Hive-JSON-Serde/json-serde/src/main/java/org/openx/data/jsonserde/objectinspector/primitive/ParsePrimitiveUtils.java
Line 30 in 8d5c1bf
Hive-JSON-Serde/json-serde/src/main/java/org/openx/data/jsonserde/objectinspector/primitive/ParsePrimitiveUtils.java
Line 31 in 8d5c1bf
The text was updated successfully, but these errors were encountered: