vergilyn opened a new issue #9341:
URL: https://github.com/apache/dubbo/issues/9341


   <!-- If you need to report a security issue please visit 
https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) 
of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.0.4
   * Operating System version: win10
   * Java version: jdk8
   
   ### Steps to reproduce this issue
   
   1. dubbo-samples 
项目中的:<https://github.com/apache/dubbo-samples/blob/b4c7fd7ef813515f59181ef16584319efc6fb738/dubbo-samples-zookeeper/src/test/java/org/apache/dubbo/samples/GreetingServiceIT.java#L41-L41>
   
   2. 适当延长 持有dubbo-cache-file 锁的时间
   `org.apache.dubbo.registry.support.AbstractRegistry#doSaveProperties` 
第187行附近。
   
![image](https://user-images.githubusercontent.com/15683879/144344861-3945e0bb-bf75-43bb-8807-738b2e28a618.png)
   
   备注:
   ```
   // 3.0.4之前的版本,只是单线程操作 dubbo-cache-file
   registryCacheExecutor = Executors.newFixedThreadPool(1, new 
NamedThreadFactory("DubboSaveRegistryCache", true));
   
   // dubbo-3.0.4,实现方式变更
   registryCacheExecutor = 
url.getOrDefaultApplicationModel().getDefaultExtension(ExecutorRepository.class).getSharedExecutor();
   ```
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Behavior
   
   <!-- What do you expect from the above steps?-->
   不要出现`OverlappingFileLockException`,并且打印过多的error日志。
   
   ### Actual Behavior
   
   <!-- What actually happens? -->
   频繁打印错误日志
   
   If there is an exception, please attach the exception trace:
   
   ```
    [Dubbo-shared-handler-thread-1] [WARN ]  [DUBBO] Failed to save registry 
cache file after retrying 3 times, cause: null, dubbo version: 3.0.4, current 
host: ......... - o.a.d.r.zookeeper.ZookeeperRegistry:205
   java.nio.channels.OverlappingFileLockException: null
        at java.base/sun.nio.ch.FileLockTable.checkList(FileLockTable.java:229)
        at java.base/sun.nio.ch.FileLockTable.add(FileLockTable.java:123)
        at 
java.base/sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1154)
        at 
java.base/java.nio.channels.FileChannel.tryLock(FileChannel.java:1165)
        at 
org.apache.dubbo.registry.support.AbstractRegistry.doSaveProperties(AbstractRegistry.java:186)
        at 
org.apache.dubbo.registry.support.AbstractRegistry$SaveProperties.run(AbstractRegistry.java:541)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
   ```
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to