Skip to content
New issue

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

RATIS-2184. Improve TestRaftWithGrpc test stability #1177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jianghuazhu
Copy link
Contributor

What changes were proposed in this pull request?

Improve stability of TestRaftWithGrpc tests.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2184

How was this patch tested?

ci:
https://github.com/jianghuazhu/ratis/actions/runs/11792452996

@jianghuazhu
Copy link
Contributor Author

@szetszwo @duongkame , can you help take it a look?
Thanks.

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jianghuazhu , thanks a lot for working on this! Please see the comments inlined.

Comment on lines +264 to +275
ReferenceCountedObject<EntryWithData> entryWithData = null;
try {
entryWithData = getRaftLog().retainEntryWithData(next);
if (!buffer.offer(entryWithData.get())) {
entryWithData.release();
break;
}
offered.put(next, entryWithData);
} catch (Exception e){
if (entryWithData != null) {
entryWithData.release();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LogAppenderDaemon failed
org.apache.ratis.server.raftlog.RaftLogIOException: Log entry not found: index = 4269
	at org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.retainEntryWithData(SegmentedRaftLog.java:334)
	at org.apache.ratis.server.leader.LogAppenderBase.nextAppendEntriesRequest(LogAppenderBase.java:264)

For the above particular exception, this change won't help since, when retainEntryWithData(..) throws an exception, entryWithData must be null.

This change will help if other methods (e.g. get(), offer(..), put(..)) throw an exception. However, these methods throw only runtime exceptions/errors (e.g. OutOfMemoryError). We may not need to handle it.

@@ -643,7 +643,7 @@
<enableProcessChecker>all</enableProcessChecker>
<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
<!-- @argLine is filled by jacoco maven plugin. @{} means late evaluation -->
<argLine>-Xmx2g -XX:+HeapDumpOnOutOfMemoryError @{argLine}</argLine>
<argLine>-Xmx8g -XX:+HeapDumpOnOutOfMemoryError @{argLine}</argLine>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When turning on the advanced reference trace, it does need more memory. I recall that I did similar change for running with advanced reference trace.

<maxmem>2048m</maxmem>
<maxmem>4096m</maxmem>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that it needs more memory for compilation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants