Copilot commented on code in PR #10765:
URL: https://github.com/apache/rocketmq/pull/10765#discussion_r3701623977
##########
proxy/src/main/java/org/apache/rocketmq/proxy/service/channel/InvocationContextInterface.java:
##########
@@ -23,4 +23,7 @@ public interface InvocationContextInterface {
void handle(RemotingCommand remotingCommand);
boolean expired(long expiredTimeSec);
+
+ default void expire(Throwable throwable) {
+ }
Review Comment:
`InvocationContextInterface.expire()` is introduced as a default no-op.
Since `InvocationChannel.clearExpireContext()` now relies on this hook to wake
up waiters, leaving it undocumented makes it easy for future implementations to
accidentally inherit the no-op and reintroduce the “future never completes”
bug. Add a brief Javadoc and an explicit no-op comment to clarify the contract.
##########
proxy/src/main/java/org/apache/rocketmq/proxy/service/channel/InvocationChannel.java:
##########
@@ -68,6 +69,7 @@ public void clearExpireContext() {
Map.Entry<Integer, InvocationContextInterface> entry =
iterator.next();
if
(entry.getValue().expired(ConfigurationManager.getProxyConfig().getChannelExpiredInSeconds()))
{
iterator.remove();
+ entry.getValue().expire(new
RemotingTimeoutException("Invocation context expired. opaque=" +
entry.getKey()));
Review Comment:
The exception message used to complete expired invocation futures doesn’t
include the configured expiry threshold or channel addresses, which makes
timeout diagnostics harder. Consider including the expiration seconds and
remote/local addresses in the message.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]