confluent-kafka-dotnet icon indicating copy to clipboard operation
confluent-kafka-dotnet copied to clipboard

Provide a way to unsubscribe from LogHandler/ErrorHandler

Open horato opened this issue 1 year ago • 3 comments

Description

There is currently no way to remove the referenced Actions from Producer/Consumer which might cause a memory leak.

var producer = new ProducerBuilder<string, string>(producerConfig)
		.SetLogHandler(LogHandler)
		.Build();

How to reproduce

Confluent.Kafka 2.3.0 librdkafka 2.3.0

Checklist

Please provide the following information:

  • [ ] A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
  • [x] Confluent.Kafka nuget version.
  • [x] Apache Kafka version.
  • [ ] Client configuration.
  • [ ] Operating system.
  • [ ] Provide logs (with "debug" : "..." as necessary in configuration).
  • [ ] Provide broker log excerpts.
  • [ ] Critical issue.

horato avatar Feb 05 '24 14:02 horato

What is the scenario for memory leaking? When you're done with the producer, the handlers would go with it.

quixoticaxis avatar Mar 19 '24 10:03 quixoticaxis

Can you provide more details?

anchitj avatar May 16 '24 09:05 anchitj

I am not sure what more details you want me to provide. I need a way to unsubscribe/unset reference to error/log handlers actions as described in the issue's title and description. Namely

ProducerBuilder<,>.ErrorHandler
ProducerBuilder<,>.LogHandler
Producer<,>.errorHandler
Producer<,>.logHandler

horato avatar May 16 '24 10:05 horato