m1a2st commented on PR #17263: URL: https://github.com/apache/kafka/pull/17263#issuecomment-2379334067
The main reason is that when a consumer needs to close, the `ConsumerCoordinator` must also close. Therefore, when the `ConsumerCoordinator` attempts to close, it calls the `commitOffsetsSync` [1] method. Inside this method, it first invokes `ensureCoordinatorReady` [2], which sends a `FindCoordinatorRequest` [3] to request server information. The topic requested here is `__consumer_offsets`. When the server receives this request, it uses `metadataCache.getTopicMetadata `[4] to look up the topic. However, since the` __consumer_offsets` topic is not present, the server returns an error code `COORDINATOR_NOT_AVAILABLE`, causing the process to continue until it times out. [1] https://github.com/apache/kafka/blob/7c429f3514dd50e98f42c74595c35b5f0b32b7d7/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java#L1144 [2] https://github.com/apache/kafka/blob/7c429f3514dd50e98f42c74595c35b5f0b32b7d7/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java#L278 [3] https://github.com/apache/kafka/blob/7c429f3514dd50e98f42c74595c35b5f0b32b7d7/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java#L904 [4] https://github.com/apache/kafka/blob/7c429f3514dd50e98f42c74595c35b5f0b32b7d7/core/src/main/scala/kafka/server/KafkaApis.scala#L1661 -- 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]
