Skip to content

Commit dea787c

Browse files
fixes
1 parent 435da72 commit dea787c

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

superclient/agent/metadata.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,26 @@ def fetch_metadata_confluent(
129129

130130
from confluent_kafka import TopicPartition # type: ignore
131131

132-
# First, try to get metadata to check if topic exists
132+
# Warm up the connection before attempting list_topics
133+
logger.debug("Warming up connection with initial poll...")
134+
try:
135+
consumer.poll(timeout=2.0)
136+
logger.debug("Connection warm-up completed")
137+
except Exception as e:
138+
logger.debug("Connection warm-up failed, continuing anyway: {}", e)
139+
140+
# Try to get topic metadata, but don't fail if it doesn't work
133141
try:
134-
# Get topic metadata to check if topic exists
135142
metadata = consumer.list_topics(topic=topic, timeout=5.0)
136143
if topic not in metadata.topics:
137144
logger.error(
138145
"[ERR-201] Superstream internal topic is missing. Please ensure permissions for superstream.* topics."
139146
)
140147
consumer.close()
141148
return None
142-
except Exception:
143-
logger.error(
144-
"[ERR-201] Superstream internal topic is missing. Please ensure permissions for superstream.* topics."
145-
)
146-
consumer.close()
147-
return None
149+
except Exception as e:
150+
logger.debug("Could not list topics, proceeding with assignment: {}", e)
151+
# Continue with topic assignment even if list_topics fails
148152

149153
# Assign to partition 0
150154
tp = TopicPartition(topic, 0)

superclient/util/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ def copy_client_configuration_properties(src: Dict[str, Any], dst: Dict[str, Any
268268
"message.send.max.retries": "message.send.max.retries",
269269
"batch.num.messages": "batch.num.messages",
270270
"compression.codec": "compression.codec",
271+
"oauth_cb": "oauth_cb",
271272
}
272273
}
273274

0 commit comments

Comments
 (0)