pulsar
pulsar copied to clipboard
[fix][client] Client interceptors close method not called after producer/consumer/reader close
Motivation
The close methods in client interceptors (ProducerInterceptor#close, ConsumerInterceptor#close, ReaderInterceptor#close) allow interceptor developers to release resources allocated in the interceptor when a producer, consumer, or reader is closed.
However, these close methods were not invoked in the implementation of PIP-23.
Modifications
- Ensure the
closemethods of interceptors are called during the final stage of the closing process. - Add unit tests to verify this behavior.
Verifying this Change
- [x] Verified that the change passes all CI checks.
This change includes the following tests:
- Integration tests for
ProducerInterceptorwith non-partitioned and partitioned topics. - Integration tests for
ConsumerInterceptorwith non-partitioned and partitioned topics. - Integration tests for
ConsumerInterceptorwith ZeroQueueConsumerImpl - Integration tests for
ReaderInterceptorwith non-partitioned and partitioned topics.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
Documentation
- [ ]
doc - [ ]
doc-required - [x]
doc-not-needed - [ ]
doc-complete
Matching PR in forked repository
PR in forked repository: https://github.com/Shawyeok/pulsar/pull/23
@codelipenghui Please feel free take a look, thanks.