[Enhancement][client][schema] Remove synchronous calls in asynchronous callback #23432
Open
1 of 2 tasks
Labels
type/enhancement
The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Search before asking
Motivation
#23378 CI failed, which reports the deadlock issue in the pulsar client.
The binary lookup uses the pulsar client's internal executor.
We are using synchronous calls in asynchronous callback.
Solution
Solution 1:
org.apache.pulsar.client.api.schema.SchemaReader#read
org.apache.pulsar.client.api.Message#getValue
This solution will change the method signature, which breaks the public interface(SchemaReader and Message).
Solution 2:
It looks like refreshTopicPoliciesCache has a deadlock, and the callback thread is broker-client-shared-internal-executor.
We can use the
pulsarService.getExecutor()
to run the callback, this can avoid the deadlock.Solution 3:
Don't use the pulsar client's internal executor in the
org.apache.pulsar.client.impl.BinaryProtoLookupService
.Alternatives
No response
Anything else?
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: