We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public void testTruncateCQ() throws Exception { { Test Case } { Test Case } ... }
由于他们复用了一个数据目录,而在第一个测试用例执行的时候,程序依然占用着数据目录中的文件句柄,导致第二个测试用例在删除文件时失败,最终断言失败:
DefaultMessageStore messageStore = createDledgerMessageStore(base, group, "n0", peers, null, false, 0); // 此时创建了24个文件
DefaultMessageStore messageStore = createDledgerMessageStore(base, group, "n0", peers, null, false, 4); // 删除4个
执行结果如下:
java.lang.AssertionError: Expected :20 Actual :24 ...
操作系统:Windows 10 (Linux 无此问题)
The text was updated successfully, but these errors were encountered:
@fangzhiheng would you like to submit a PR. to fix it?
Sorry, something went wrong.
不知道算是DLedger库的问题,还是测试用例的问题,所以我把问题的原因及解决方案贴出来吧 原因: DLedgerMmapFileStore在关闭的时候,其内部的MmapFileList#dataFileList没有关闭它所持有的MmapFile#fileChannel 及MmapFile#mappedByteBuffer,因此导致句柄无法回收。 解决办法: 可以在测试用例MessageStore#shutdown后,分别关闭FileChannel以及MappedByteBuffer即可。
但是我认为可能是DLedger库的一个问题 :)
I submit a PR for dledger repo, i think it should be fixed by them.
Successfully merging a pull request may close this issue.
由于他们复用了一个数据目录,而在第一个测试用例执行的时候,程序依然占用着数据目录中的文件句柄,导致第二个测试用例在删除文件时失败,最终断言失败:
执行结果如下:
操作系统:Windows 10 (Linux 无此问题)
The text was updated successfully, but these errors were encountered: