confluentinc / kafka-rest

Confluent REST Proxy for Kafka
https://docs.confluent.io/current/kafka-rest/docs/index.html
Other
2.25k stars 641 forks source link

KNET-14986: Uncaught exception while closing input stream is causing … #1264

Closed akhileshchg closed 2 months ago

akhileshchg commented 2 months ago

…clean up failures.

InpuStream close just handles the IOException. But when the there are unused streams Jersey throws BadRequestException instead of IOException. This uncaught exception disrupts the outbound response closure leaving the producer thread behind.

cla-assistant[bot] commented 2 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

trnguyencflt commented 2 months ago

@akhileshchg are you able to resolve the issue with this change?

ehumber commented 2 months ago

Nice work, this code is so twisty, not a nice introductory task at all!

As Mayank says, could you add some details on how this fixes the problem please.

It looks like

Is that right?

akhileshchg commented 2 months ago

Nice work, this code is so twisty, not a nice introductory task at all!

As Mayank says, could you add some details on how this fixes the problem please.

It looks like

Is that right?

Yes. You're right.

msn-tldr commented 2 months ago

@ehumber & @akhileshchg thanks for writing down the detailed break down of how thread leak happens.