]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Disable parallel graph.tg/header read, serializer ctor not thread-safe 81/1581/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 15 Mar 2018 14:33:04 +0000 (16:33 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 15 Mar 2018 14:33:04 +0000 (16:33 +0200)
Having parallel() here caused random platform startup problems and
doesn't account for any major speedup in normal use anyway.

refs #7806

Change-Id: I37b26a3df622d4ad3b2ad744e43e2f08cf0284ff

bundles/org.simantics.project/src/org/simantics/project/management/PlatformUtil.java

index ac08db001142e0b7b8b4131f101bb7e3c0f90d69..9dfa67efef7be394081c583f325b09ed63dfea4e 100644 (file)
@@ -315,7 +315,11 @@ public class PlatformUtil {
                AtomicReference<IOException> problem = new AtomicReference<>();
 
                Collection<GraphBundle> gbundles = Arrays.stream(getBundles())
-                               .parallel()
+                               // #7806: Due to databoard Binding/Serializer construction process thread-unsafety
+                               // not even the DataContainer.readHeader invocations can run in parallel, most likely
+                               // due to recurring serializer construction for Variant datatypes.
+                               // Therefore, we must disable parallel loading for now.
+                               //.parallel()
                                .map(b -> {
                                        try {
                                                return problem.get() == null ? getGraph(b) : null;