rdhabalia opened a new pull request #5988: [pulsar-broker] Clean up closed producer to avoid publish-time for producer URL: https://github.com/apache/pulsar/pull/5988 ### Motivation We found many instances where broker close the producer without clearing from cache, because of that broker doesn't allow new producer with same id to be created on the same connection and fail the publish messages with error "producer is already closed" ``` # (1) new producer request came 4:31:15.317 [ForkJoinPool.commonPool-worker-23] INFO org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606][persistent://prod-tenant/global/prod-ns/dc1:dc1747e8f] Creating producer. producerId=1038 : # (2) broker couldn't create producer in 30 secs and after 30 seconds broker receives close producer request. Broker closes it without clearing from cache 14:31:45.191 [pulsar-io-22-20] INFO org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606] Closed producer 549 before its creation was completed 14:31:45.191 [pulsar-io-22-20] INFO org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606] Closed producer 581 before its creation was completed 14:31:45.192 [pulsar-io-22-20] INFO org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606] Closed producer 621 before its creation was completed 14:31:45.192 [pulsar-io-22-20] INFO org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606] Closed producer 894 before its creation was completed 14:31:45.192 [pulsar-io-22-20] INFO org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606] Closed producer 1038 before its creation was completed : : # (3) Broker ignores new producer request because producer already present on that connection 14:31:45.292 [ForkJoinPool.commonPool-worker-47] WARN org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606][581] Producer with id persistent://prod-tenant/global/prod-ns/257769db47033c3abbd618141106063fc0e1a743801396f1fd4f11f95d3e457b\:WEB\:1530064:258 is already present on the connection 14:31:45.293 [ForkJoinPool.commonPool-worker-47] WARN org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606][621] Producer with id persistent://prod-tenant/global/prod-ns/93b:93b78d8338c40b6a39d27df59df7f3005bcfd9972804df360ed1b176c2e9ba15\:WEB\:15283350 is already present on the connection 14:31:45.293 [ForkJoinPool.commonPool-worker-47] WARN org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606][894] Producer with id persistent://prod-tenant/global/prod-ns/5b6:5b679b830 is already present on the connection 14:31:45.293 [ForkJoinPool.commonPool-worker-23] WARN org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606][1038] Producer with id persistent://prod-tenant/global/prod-ns/dc1:dc1747e8f is already present on the connection : : # (4) Publish fails because producer is already closed 14:31:47.906 [pulsar-io-22-20] WARN org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606] Producer had already been closed: 581 14:31:47.906 [pulsar-io-22-20] WARN org.apache.pulsar.broker.service.ServerCnx - [/1.1.1.1:33606] Producer had already been closed: 581 ``` So, broker should remove the closed and failed producer from the cache to allow creation of new producer and it will avoid publish failure due to "producer already closed" error.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
