You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "jianghuazhu (via GitHub)" <gi...@apache.org> on 2025/05/08 03:06:14 UTC
[PR] RATIS-2288. Add some assertions to RaftServerImpl to improve robustness [ratis]
jianghuazhu opened a new pull request, #1254:
URL: https://github.com/apache/ratis/pull/1254
## What changes were proposed in this pull request?
When executing RaftServerImpl#getTransactionContext(), it may return null. We should add some assertions.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-2288
## How was this patch tested?
ci:
https://github.com/jianghuazhu/ratis/actions/runs/14897497515
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2288. Add some assertions to RaftServerImpl to improve robustness [ratis]
Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo commented on code in PR #1254:
URL: https://github.com/apache/ratis/pull/1254#discussion_r2080296811
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -1914,6 +1914,7 @@ CompletableFuture<Message> applyLogToStateMachine(ReferenceCountedObject<LogEntr
break;
case STATEMACHINELOGENTRY:
TransactionContext trx = getTransactionContext(next, true);
+ Preconditions.assertNotNull(trx, "trx");
Review Comment:
Let's use
```java
Objects.requireNonNull(trx, "trx == null");
```
We added it for the pre Java 7 JDK.
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2288. Add some assertions to RaftServerImpl to improve robustness [ratis]
Posted by "jianghuazhu (via GitHub)" <gi...@apache.org>.
jianghuazhu commented on code in PR #1254:
URL: https://github.com/apache/ratis/pull/1254#discussion_r2080826373
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -1914,6 +1914,7 @@ CompletableFuture<Message> applyLogToStateMachine(ReferenceCountedObject<LogEntr
break;
case STATEMACHINELOGENTRY:
TransactionContext trx = getTransactionContext(next, true);
+ Preconditions.assertNotNull(trx, "trx");
Review Comment:
Thanks @szeto for the comment and review.
I will fix this in RATIS-2180.
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2288. Add some assertions to RaftServerImpl to improve robustness [ratis]
Posted by "jianghuazhu (via GitHub)" <gi...@apache.org>.
jianghuazhu closed pull request #1254: RATIS-2288. Add some assertions to RaftServerImpl to improve robustness
URL: https://github.com/apache/ratis/pull/1254
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org