shunping commented on code in PR #30758:
URL: https://github.com/apache/beam/pull/30758#discussion_r1628000031


##########
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/TimeUtil.java:
##########
@@ -57,7 +57,10 @@ public static String toCloudTime(ReadableInstant instant) {
     // millisecond resolution.
 
     // Translate the ReadableInstant to a DateTime with ISOChronology.
-    DateTime time = new DateTime(instant);
+    // We avoid passing `instant` directly to the constructor because that 
constructor calls into
+    // the thread-unsafe ConverterManager. Instead, we pass 
`instant.getMillis()`, which doesn't
+    // trigger the pluggable conversion system.
+    DateTime time = new DateTime(instant.getMillis());

Review Comment:
   How about changing this to the following?
   ```
   DateTime time = new DateTime(instant.getMillis(), instant.getZone());
   ```
   
   @cpovirk @Abacn 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to