TaiJuWu commented on code in PR #18447:
URL: https://github.com/apache/kafka/pull/18447#discussion_r1908077543
##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -3066,40 +2962,7 @@ class KafkaApis(val requestChannel: RequestChannel,
.setErrorCode(Errors.DELEGATION_TOKEN_REQUEST_NOT_ALLOWED.code)
.setExpiryTimestampMs(DelegationTokenManager.ErrorTimestamp)))
} else {
- maybeForwardToController(request, handleExpireTokenRequestZk)
Review Comment:
ditto
##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -3066,40 +2962,7 @@ class KafkaApis(val requestChannel: RequestChannel,
.setErrorCode(Errors.DELEGATION_TOKEN_REQUEST_NOT_ALLOWED.code)
.setExpiryTimestampMs(DelegationTokenManager.ErrorTimestamp)))
} else {
- maybeForwardToController(request, handleExpireTokenRequestZk)
- }
- }
-
- def handleExpireTokenRequestZk(request: RequestChannel.Request): Unit = {
- val zkSupport =
metadataSupport.requireZkOrThrow(KafkaApis.shouldAlwaysForward(request))
-
- val expireTokenRequest = request.body[ExpireDelegationTokenRequest]
-
- // the callback for sending a expire token response
- def sendResponseCallback(error: Errors, expiryTimestamp: Long): Unit = {
- trace("Sending expire token response for correlation id %d to client %s."
- .format(request.header.correlationId, request.header.clientId))
- requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs =>
- new ExpireDelegationTokenResponse(
- new ExpireDelegationTokenResponseData()
- .setThrottleTimeMs(requestThrottleMs)
- .setErrorCode(error.code)
- .setExpiryTimestampMs(expiryTimestamp)))
- }
- // DelegationToken changes only need to be executed on the controller
during migration
- if (!zkSupport.controller.isActive) {
- requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs =>
- new ExpireDelegationTokenResponse(
- new ExpireDelegationTokenResponseData()
- .setThrottleTimeMs(requestThrottleMs)
- .setErrorCode(Errors.NOT_CONTROLLER.code)))
- } else {
- tokenManager.expireToken(
- request.context.principal,
- expireTokenRequest.hmac(),
- expireTokenRequest.expiryTimePeriod(),
- sendResponseCallback
- )
+ maybeForwardToController(request, null)
Review Comment:
ditto
--
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]