You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "iamsanjaymalakar (via GitHub)" <gi...@apache.org> on 2026/03/07 10:01:04 UTC
[I] [Bug] CompositeInputStream.close() may leak underlying streams when one close() throws [dubbo]
iamsanjaymalakar opened a new issue, #16117:
URL: https://github.com/apache/dubbo/issues/16117
### Pre-check
- [x] I am sure that all the content I provide is in English.
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Dubbo Version
Dubbo Java 3.3, Ubuntu 20.04
### Steps to reproduce this issue
Resource leak, non-deterministic.
### What you expected to happen
`CompositeInputStream.close()` should attempt to close all underlying streams, even if one close() throws. After trying all closes, it should throw the first `IOException` and attach later close failures as suppressed exceptions (if any).
This prevents partial cleanup and potential resource leaks.
### Anything else
Current behavior: CompositeInputStream.close() stops at the first IOException, leaving remaining streams unclosed.
Frequency: Every time an underlying stream’s close() throws.
Proposed fix: Wrap each close() in try/catch while draining the queue, collect the first IOException, suppress subsequent failures, and throw after attempting all closes.
### Do you have a (mini) reproduction demo?
- [ ] Yes, I have a minimal reproduction demo to help resolve this issue more effectively!
### Are you willing to submit a pull request to fix on your own?
- [x] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [Bug] CompositeInputStream.close() may leak underlying streams when one close() throws [dubbo]
Posted by "RainYuY (via GitHub)" <gi...@apache.org>.
RainYuY closed issue #16117: [Bug] CompositeInputStream.close() may leak underlying streams when one close() throws
URL: https://github.com/apache/dubbo/issues/16117
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] [Bug] CompositeInputStream.close() may leak underlying streams when one close() throws [dubbo]
Posted by "hqqw2h-lgtm (via GitHub)" <gi...@apache.org>.
hqqw2h-lgtm commented on issue #16117:
URL: https://github.com/apache/dubbo/issues/16117#issuecomment-4186443263
I'd like to work on this. Will fix CompositeInputStream.close() to properly close all underlying streams and collect suppressed exceptions.
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org