kirktrue opened a new pull request, #15186:
URL: https://github.com/apache/kafka/pull/15186

   This change restores the previous behavior for the `Fetcher` to keep its 
internal `sessionHandlers` cache even after `close()` is invoked.
   
   During the `close()` of a `Consumer`, the `Fetcher` attempts to send out 
`FetchRequest`s to signal to the relevant brokers that the consumer is closing. 
This allows the broker to clean up relevant resources on its end.
   
   The `Fetcher` was recently changed (3.5) to clear its `sessionHandlers` 
cache immediately after it finished creating the final `FetchRequest`s. The 
reasoning was that since the `Fetcher` is being closed, those session handlers 
were no longer needed, and thus the cache could safely be cleared.
   
   However, it is evidently possible that the `Fetcher`'s response handler can 
still be invoked if a response for an in-flight `FetchRequest` is received 
shortly after that cache was cleared. (There doesn't appear to be logic in the 
`Fetcher` that blocks response handling after it is closed.) In this case, once 
the `Fetcher`'s response handler determines it cannot find the 
`FetchSessionHandler` in the `sessionHandlers` cache, it logs the error and 
aborts processing.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to