liferoad commented on code in PR #34007:
URL: https://github.com/apache/beam/pull/34007#discussion_r1959795218


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileSystems.java:
##########
@@ -586,15 +588,17 @@ public static void 
setDefaultPipelineOptions(PipelineOptions options) {
         return;
       }
 
-      if (FILESYSTEM_REVISION.compareAndSet(revision, KV.of(id, 
nextRevision))) {
-        Set<FileSystemRegistrar> registrars =
-            Sets.newTreeSet(ReflectHelpers.ObjectsClassComparator.INSTANCE);
-        registrars.addAll(
-            Lists.newArrayList(
-                ServiceLoader.load(FileSystemRegistrar.class, 
ReflectHelpers.findClassLoader())));
-
-        SCHEME_TO_FILESYSTEM.set(verifySchemesAreUnique(options, registrars));
-        return;
+      synchronized (lock) {
+        if (FILESYSTEM_REVISION.compareAndSet(revision, KV.of(id, 
nextRevision))) {

Review Comment:
   @kennknowles what do you think about this? is it safe to remove atomic from 
FILESYSTEM_REVISION?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to