You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "haiyang1985 (GitHub)" <gi...@apache.org> on 2019/08/19 04:09:06 UTC

[GitHub] [dubbo] haiyang1985 opened issue #4867: DubboSaveRegistryCache thread cost a lot of cpu time when device is full

- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.3 & 2.5.10
* Operating System version: mac
* Java version: JDk 1.8

### Steps to reproduce this issue

1. DubboSaveRegistryCache thread cost a lot of cpu when device is full. 
```
 [DUBBO] Failed to save registry store file, cause: No space left on device, dubbo version: 2.0.1, current host: 10.14.129.133
java.io.IOException: No space left on device
	at java.io.FileOutputStream.writeBytes(Native Method)
	at java.io.FileOutputStream.write(FileOutputStream.java:326)
	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
	at java.io.BufferedWriter.flush(BufferedWriter.java:254)
	at java.util.Properties.store0(Properties.java:844)
	at java.util.Properties.store(Properties.java:818)
	at com.alibaba.dubbo.registry.support.AbstractRegistry.doSaveProperties(AbstractRegistry.java:169)
	at com.alibaba.dubbo.registry.support.AbstractRegistry$SaveProperties.run(AbstractRegistry.java:490)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
```
2. when device is full, it will retry doSaveProperties and log warn in infinite loop.

Pls. provide [GitHub address] to reproduce this issue.

### Expected Result
Seems the version check is not takes effect, doSaveProperties should be stopped.

### Actual Result
retry doSaveProperties when device is full takes a lot of cpu time.



[ Full content available at: https://github.com/apache/dubbo/issues/4867 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org