You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/01/20 07:08:55 UTC

[GitHub] wu-sheng removed a comment on issue #2183: The locking mechanism for inventory registration is not valid when the brain is split.

wu-sheng removed a comment on issue #2183: The locking mechanism for inventory registration is not valid when the brain is split.
URL: https://github.com/apache/incubator-skywalking/issues/2183#issuecomment-455841339
 
 
   @JaredTan95 At my local test, if I add `Thread.sleep(200L);` in `H2BatchDAO`, like this
   ```java
   package org.apache.skywalking.oap.server.storage.plugin.jdbc.h2.dao;
   
   
   /**
    * @author wusheng
    */
   public class H2BatchDAO implements IBatchDAO {
       private static final Logger logger = LoggerFactory.getLogger(H2BatchDAO.class);
   
       private JDBCHikariCPClient h2Client;
   
       public H2BatchDAO(JDBCHikariCPClient h2Client) {
           this.h2Client = h2Client;
       }
   
       @Override public void batchPersistence(List<?> batchCollection) {
           if (batchCollection.size() == 0) {
               return;
           }
   
           if (logger.isDebugEnabled()) {
               logger.debug("batch sql statements execute, data size: {}", batchCollection.size());
           }
   
           try (Connection connection = h2Client.getConnection()) {
               for (Object exe : batchCollection) {
                   SQLExecutor sqlExecutor = (SQLExecutor)exe;
                   sqlExecutor.invoke(connection);
               }
   
               Thread.sleep(200L);
           } catch (SQLException | JDBCClientException | InterruptedException e) {
               logger.error(e.getMessage(), e);
           }
       }
   }
   
   ```
   
   The error is gone.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services