pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix][client] Client interceptors close method not called after producer/consumer/reader close

Open Shawyeok opened this issue 1 year ago • 1 comments

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 close methods 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 ProducerInterceptor with non-partitioned and partitioned topics.
  • Integration tests for ConsumerInterceptor with non-partitioned and partitioned topics.
  • Integration tests for ConsumerInterceptor with ZeroQueueConsumerImpl
  • Integration tests for ReaderInterceptor with 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

Shawyeok avatar Jan 09 '25 07:01 Shawyeok

@codelipenghui Please feel free take a look, thanks.

Shawyeok avatar Jan 09 '25 08:01 Shawyeok