chia7712 commented on code in PR #19355:
URL: https://github.com/apache/kafka/pull/19355#discussion_r2068724036


##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -2472,7 +2472,17 @@ class KafkaApis(val requestChannel: RequestChannel,
     val filteredProducerIds = 
listTransactionsRequest.data.producerIdFilters.asScala.map(Long.unbox).toSet
     val filteredStates = 
listTransactionsRequest.data.stateFilters.asScala.toSet
     val durationFilter = listTransactionsRequest.data.durationFilter()
-    val response = txnCoordinator.handleListTransactions(filteredProducerIds, 
filteredStates, durationFilter)
+    val transactionalIdPatternFilter = if 
(listTransactionsRequest.data.transactionalIdPattern == null) {
+      ""

Review Comment:
   ```scala
           val pattern = if (filterTransactionalIdPattern.nonEmpty) {
             try {
               Pattern.compile(filterTransactionalIdPattern)
             }
             catch {
               case e: PatternSyntaxException =>
                 throw new InvalidRegularExpression(String.format("Transaction 
ID pattern `%s` is not a valid regular expression: %s.", 
filterTransactionalIdPattern, e.getMessage))
             }
           } else null
   ```
   
   It seems `TransactionStateManager` does not check the null for 
`filterTransactionalIdPattern`



-- 
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]

Reply via email to