zjncs opened a new pull request, #11139:
URL: https://github.com/apache/rocketmq/pull/11139
### Motivation
`ContextInitPipeline` only records the remaining deadline time when the gRPC
call actually carries a deadline. For a call without one — which gRPC allows —
`ctx.getRemainingMs()` returned null and the unboxing in the polling-time
computation threw a `NullPointerException`, which the catch block turned into
an `INTERNAL_SERVER_ERROR` response.
### Modifications
Treat an absent deadline as `grpcClientConsumerMaxLongPollingTimeoutMillis`
remaining time, so polling time and the timeout passed to `popMessage` stay
bounded by the configured maximum instead of crashing.
### Verification
Fail-before (new test, run against the unpatched code):
```
ReceiveMessageActivityTest#testReceiveMessageWithoutDeadline
java.lang.AssertionError: expected:<MESSAGE_NOT_FOUND> but
was:<INTERNAL_SERVER_ERROR>
ReceiveMessageActivityTest.testReceiveMessageWithoutDeadline:456
(root cause: NullPointerException on "Long.longValue()" because
"timeRemaining" is null)
```
Pass-after:
```
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0 --
ReceiveMessageActivityTest
```
--
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]