You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "imbajin (via GitHub)" <gi...@apache.org> on 2023/10/23 08:40:21 UTC

Re: [PR] fix(core): handle schema Cache expandCapacity concurrent problem [incubator-hugegraph]

imbajin commented on code in PR #2332:
URL: https://github.com/apache/incubator-hugegraph/pull/2332#discussion_r1368318873


##########
hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/ram/IntObjectMap.java:
##########
@@ -29,8 +29,8 @@ public final class IntObjectMap<V> implements RamMap {
     private static final float DEFAULT_INITIAL_FACTOR = 0.25f;
 
     private final int maxSize;
-    private int currentSize;
-    private Object[] array;
+    private volatile int currentSize;
+    private volatile Object[] array;

Review Comment:
   seems we just need mark it as `final` to ensure the init integrity? could try it to ensure
   ```suggestion
       private final Object[] array;
   ```



-- 
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: issues-unsubscribe@hugegraph.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org