question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AbstractRegistry lock problem

See original GitHub issue

环境:

  • suse linux
  • dubbo 2.5.3

dubbo启动时会报:

2014-08-29 19:13:52,325 WARN  com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.doSaveProperties:221 -  [DUBBO] Failed to save registry store file, cause: Can not lock the registry cache file /uniiof/tstusers/tstweg02/.dubbo/dubbo-registry-133.0.192.193.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties, dubbo version: 2.5.3, current host: 127.0.0.1
java.io.IOException: Can not lock the registry cache file /uniiof/tstusers/tstweg02/.dubbo/dubbo-registry-133.0.192.193.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties
    at com.alibaba.dubbo.registry.support.AbstractRegistry.doSaveProperties(AbstractRegistry.java:193)
    at com.alibaba.dubbo.registry.support.AbstractRegistry$SaveProperties.run(AbstractRegistry.java:150)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)

从异常看,是多个线程都要写信息,导致不能获取锁,同时也不尝试再次获取

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:15

github_iconTop GitHub Comments

4reactions
justeincommented, Apr 15, 2016

@dudi123456 @Xiaobaxi 解决了,出现这个的原因是服务向ZK注册的同时,会缓存Consumer的列表,写入user.home/.dubbo/dubbo-registry-" + url.getHost() + ".cache 这个文件,当在同一个机器上启动多个Provider的时候,就会出现文件锁争用的问题,报上面这个错误。解决办法:服务模块各自缓存自己的cache文件,在<dubbo:registry />中加入 file=“dubboregistry/dubbo-registry.properties” ,这样就会在bin目录下生成dubboregistry这个目录,cache文件就缓存在这个里边了。

0reactions
yekuicommented, Oct 22, 2018

2018-10-15 22:55:24,780 WARN [DubboSaveRegistryCache-thread-1] c.a.d.c.u.DubboLogger - [DUBBO] Failed to save registry store file, cause: null, dubbo version: 3.2.0, current host: xxx java.nio.channels.OverlappingFileLockException: null at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255) at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152) at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1108) at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155) at com.alibaba.dubbo.registry.support.AbstractRegistry.doSaveProperties(AbstractRegistry.java:187) at com.alibaba.dubbo.registry.support.AbstractRegistry$SaveProperties.run(AbstractRegistry.java:146) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

这个应该不是多进程并发导致的吧

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GitHub] Julvae commented on issue #81: AbstractRegistry lock ...
Julvae commented on issue #81: AbstractRegistry lock problem URL: https://github.com/apache/incubator-dubbo/issues/81#issuecomment-396043794 .cache文件内容 ...
Read more >
Dubbo Failed to save registry store file, Cause:can not lock the ...
The Dubbo service started with an error, the exception information is as follows: 2016-08-22 16:44:40.588 ... Abstractregistry Lock PROBLEM:HTTPS://GITHUB.
Read more >
Does custom policy support cache scope - MuleSoft Help Center
When I a created the custom policy and applied i got a failure. Would like to know does the custom policy supports the...
Read more >
AbstractRegistry (Mule ESB 3.4.0-RC5-SNAPSHOT API)
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule ...
Read more >
java.nio.channels.FileChannel.tryLock java code examples
tryLock(0, 1024, false); return lockFile != null; } catch (IOException e) { throw ... catch (IOException e) { LOGGER.error("Cannot create lock on "...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found