rdhabalia commented on issue #4741: Remove failed stale producer from the 
connection
URL: https://github.com/apache/pulsar/pull/4741#issuecomment-512612082
 
 
   @merlimat 
   No, actually check was added as part of #4145 and #4138 to fix the same 
issue (`Producer/Consumer is already connected`)  but that PR was trying to 
remove wrong producer/consumer which is not present into the cache so, 
underlying issue was not fixed.
   
   I modified the test because test was wrong and having exact same issue which 
we are trying to fix: test-sequence was
   1. try to create consumer (which will not be created immediately because 
test has delayed topic creation logic)
   2. close the consumer: which fails the [pending-consumer 
future](https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java#L1237)
 and doesn't clean up from the cache.
   3. so, any subsequent consumer request always receives error: `Consumer with 
id is already connected`. Test was checking not that failure reason of consumer 
should not be `consumer is already connected` else we could have caught it long 
time back.
   Because broker was never cleaning failed future and because of the consumer 
will never be able to connect.
   
   Same thing was happening for producers and we are keep seeing this issue 
when broker unloads the bundle to different broker and same bundle again comes 
back to the old broker. the entire issue was described into #4138. So, we tried 
to fix in #4138 but tried to remove producer-future for current request which 
is definitely not in the cache and therefore, client keeps seeing error 
`Producer is already connected` and we have to manually restart the broker to 
fix this issue.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to