<@U078Y59KC3B> why following exception would occur...
# ask-ai
m
@RunLLM why following exception would occur
Copy code
ERROR org.apache.pulsar.broker.service.ServerCnx - A failed consumer with id is already present on the connection. consumerId: 5, remoteAddress: /<host>:44014, subscription: abc:xyx
2025-04-17T00:53:50.420623165Z stdout F java.util.concurrent.CompletionException: java.lang.IllegalStateException: Closed consumer before creation was complete
r
The exception "A failed consumer with id is already present on the connection" occurs when there is an attempt to create a consumer with an ID that is already associated with a failed consumer on the same connection. This situation can arise due to race conditions where a consumer creation request is in progress, but the connection is closed before the consumer is fully created. As a result, the consumer is marked as failed, and subsequent attempts to create a consumer with the same ID on the same connection will encounter this error. According to the GitHub pull request, this issue can occur under conditions where the connection is unstable, and the server connection (
ServerCnx
) thread is busy. The consumer creation process may not complete successfully, leading to a failed future in the server connection's consumer list. This failed future prevents new consumer creation requests with the same ID from succeeding until the previous operation is fully resolved. Would you like more details on how to handle or prevent this issue? Sources: - GitHub pull request 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.