liaoxin01 commented on code in PR #61324:
URL: https://github.com/apache/doris/pull/61324#discussion_r2992019120


##########
be/src/load/routine_load/data_consumer.cpp:
##########
@@ -315,6 +336,20 @@ Status 
KafkaDataConsumer::group_consume(BlockingQueue<RdKafka::Message*>* queue,
 }
 
 Status KafkaDataConsumer::get_partition_meta(std::vector<int32_t>* 
partition_ids) {
+    if (_aws_msk_oauth_callback) {
+        // Trigger OAuth token refresh by polling the event loop
+        // librdkafka's OAUTHBEARER callback is only triggered through 
consume()/poll()
+        // Without this, metadata() will fail because broker is waiting for 
OAuth token
+        LOG(INFO) << "Polling to trigger OAuth token refresh before metadata 
request";
+        int max_poll_attempts = 10; // 10 × 500ms = 5 seconds max
+        for (int i = 0; i < max_poll_attempts; i++) {
+            RdKafka::Message* msg = _k_consumer->consume(500);

Review Comment:
   Will get meta consume data? Won't it lead to less data being imported?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to