mimaison commented on code in PR #17636:
URL: https://github.com/apache/kafka/pull/17636#discussion_r1829235058
##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -93,18 +94,18 @@ class DelayedOperations(topicId: Option[Uuid],
produce: DelayedOperationPurgatory[DelayedProduce],
fetch: DelayedOperationPurgatory[DelayedFetch],
deleteRecords:
DelayedOperationPurgatory[DelayedDeleteRecords],
- shareFetch:
DelayedOperationPurgatory[DelayedShareFetch]) {
+ shareFetch:
DelayedOperationPurgatory[DelayedShareFetch]) extends Logging {
def checkAndCompleteAll(): Unit = {
- val requestKey = TopicPartitionOperationKey(topicPartition)
- CoreUtils.swallow(() -> fetch.checkAndComplete(requestKey), fetch,
Level.ERROR)
- CoreUtils.swallow(() -> produce.checkAndComplete(requestKey), produce,
Level.ERROR)
- CoreUtils.swallow(() -> deleteRecords.checkAndComplete(requestKey),
deleteRecords, Level.ERROR)
+ val requestKey = new TopicPartitionOperationKey(topicPartition)
+ CoreUtils.swallow(() -> fetch.checkAndComplete(requestKey), this,
Level.ERROR)
Review Comment:
The current behavior does not provide any extra information that would be
useful for debugging. The 2 behavior are very similar, the source class changes
from `kafka.server.DelayedOperationPurgatory` to
`kafka.cluster.DelayedOperations`.
Current behavior:
```
[2024-11-05 12:58:11,696] ERROR uh oh
(kafka.server.DelayedOperationPurgatory)
java.lang.RuntimeException: uh oh
at
kafka.server.DelayedOperationPurgatory.checkAndComplete(DelayedOperation.scala:268)
at
kafka.cluster.DelayedOperations.$anonfun$checkAndCompleteAll$2(Partition.scala:101)
at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:67)
at
kafka.cluster.DelayedOperations.checkAndCompleteAll(Partition.scala:101)
at
kafka.cluster.Partition.tryCompleteDelayedRequests(Partition.scala:1250)
at
kafka.cluster.PartitionTest.tryCompleteDelayedRequestsCatchesExceptions(PartitionTest.scala:4132)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
```
PR behavior:
```
[2024-11-05 12:55:04,249] ERROR uh oh (kafka.cluster.DelayedOperations)
java.lang.RuntimeException: uh oh
at
org.apache.kafka.server.purgatory.DelayedOperationPurgatory.checkAndComplete(DelayedOperationPurgatory.java:175)
at
kafka.cluster.DelayedOperations.$anonfun$checkAndCompleteAll$3(Partition.scala:103)
at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:67)
at
kafka.cluster.DelayedOperations.checkAndCompleteAll(Partition.scala:103)
at
kafka.cluster.Partition.tryCompleteDelayedRequests(Partition.scala:1251)
at
kafka.cluster.PartitionTest.tryCompleteDelayedRequestsCatchesExceptions(PartitionTest.scala:4133)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
```
--
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]