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

[I] [Bug] Schema Cache expandCapacity concurrent issue [incubator-hugegraph]

qwtsc opened a new issue, #2330:
URL: https://github.com/apache/incubator-hugegraph/issues/2330

   ### Bug Type (问题类型)
   
   other exception / error (其他异常报错)
   
   ### Before submit
   
   - [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
   
   ### Environment (环境信息)
   
   see the following error-log
   ```java
   org.apache.hugegraph.exception.ServerException: Index 32 out of bounds for length 32
   ```
   
   ### Expected & Actual behavior (期望与实际表现)
   
   ```java
       public void set(int key, V value) {
           if (key >= this.currentSize) {
               this.expandCapacity();
           }
           // this.array is not the one that has done expandCapacity!
           this.array[key] = value;
       }
   
       private synchronized void expandCapacity() {
           if (this.currentSize == this.maxSize) {
               return;
           }
           this.currentSize = Math.min(this.currentSize * 2, this.maxSize);
           Object[] newArray = new Object[this.currentSize];
           System.arraycopy(this.array, 0, newArray, 0, this.array.length);
           this.clear();
           this.array = newArray;
       }
   ```
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   _No response_
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   _No response_


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

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


Re: [I] [Bug] Schema Cache expandCapacity concurrent issue [incubator-hugegraph]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on issue #2330:
URL: https://github.com/apache/incubator-hugegraph/issues/2330#issuecomment-1772070634

   Thanks, could submit a PR including related test for it
   
   @conghuhu free to take a look with it~


-- 
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


Re: [I] [Bug] Schema Cache expandCapacity concurrent issue [incubator-hugegraph]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on issue #2330:
URL: https://github.com/apache/incubator-hugegraph/issues/2330#issuecomment-1807111890

   follow-up: https://github.com/apache/incubator-hugegraph/pull/2332#issuecomment-1807111314


-- 
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


Re: [I] [Bug] Schema Cache expandCapacity concurrent issue [incubator-hugegraph]

Posted by "qwtsc (via GitHub)" <gi...@apache.org>.
qwtsc commented on issue #2330:
URL: https://github.com/apache/incubator-hugegraph/issues/2330#issuecomment-1771993118

   1. use volatile
   2. In expandCapacity, write this.currentSize field after write this.array, or just use this.array.length.


-- 
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


Re: [I] [Bug] Schema Cache expandCapacity concurrent issue [incubator-hugegraph]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin closed issue #2330: [Bug] Schema Cache expandCapacity concurrent issue
URL: https://github.com/apache/incubator-hugegraph/issues/2330


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

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


Re: [I] [Bug] Schema Cache expandCapacity concurrent issue [incubator-hugegraph]

Posted by "conghuhu (via GitHub)" <gi...@apache.org>.
conghuhu commented on issue #2330:
URL: https://github.com/apache/incubator-hugegraph/issues/2330#issuecomment-1773700375

   ok, plz assign to me


-- 
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