-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
type/bugThe PR fixed a bug or issue reported a bugThe PR fixed a bug or issue reported a bug
Milestone
Description
Describe the bug
In the situation I confirmed, when entering the logic, C._pulsar_producer_close_async() gets stuck with c<-err in callback and <-c is not executed.
Therefore, Producer::Close() does not finish.
To Reproduce
Steps to reproduce the behavior:
- Producer connects to broker
- Revoke the producer's permission to produce(e.g.
pulsar-admin namespaces revoke-permission --role "producer.role" public/global/n1) - Execute
Producer.Close()
I confirmed I can avoid the issue in the following ways.
But I don’t know the best way(Should we modify c++ code?).
- Use
go
func (p *producer) CloseAsync(callback func(error)) {
- C._pulsar_producer_close_async(p.ptr, savePointer(callback))
+ go C._pulsar_producer_close_async(p.ptr, savePointer(callback))
}
- Use
C.pulsar_producer_close()likeClient.Close()
func (p *producer) Close() error {
res := C.pulsar_producer_close(p.ptr)
if res != C.pulsar_result_Ok {
return newError(res, "Failed to close Pulsar client")
} else {
return nil
}
}
Metadata
Metadata
Assignees
Labels
type/bugThe PR fixed a bug or issue reported a bugThe PR fixed a bug or issue reported a bug