[Bug] Make composite input stream handling safe when stream close races with an in-progress read
- Dominant language
- Java
- Stars
- 41.6k
- Forks
- 26.4k
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 4
Description
### 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.7-SNAPSHOT, OpenJDK 25, WINDOWS
### Steps to reproduce this issue
Fix composite input stream handling so that closing a stream while a concurrent read operation is actively consuming data does not cause unexpected stream closed exceptions or state corruption. When a client connection terminates abruptly during HTTP/2 streaming, the transport layer triggers a stream closure on the I/O event thread, which can execute simultaneously while an application worker thread is reading from the composite input stream for that same request. The composite stream handling must safely synchronize or manage concurrent closure during active reads so that in-flight read operations complete or terminate cleanly without raising unhandled concurrent access errors.
### What you expected to happen
The composite stream handling must safely synchronize or manage concurrent closure during active reads so that in-flight read operations complete or terminate cleanly without raising unhandled concurrent access errors.
### Anything else
_No response_
### Do you have a (mini) reproduction demo?
- [x] 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)
Contributor guide
Research direction
Start by locating the composite input stream implementation and the HTTP/2 transport path that closes it on the I/O event thread. Reproduce a concurrent read and close using the reported minimal demo, then inspect the resulting exceptions and state changes. Done means in-flight reads complete or terminate cleanly without unhandled close errors or corrupted stream state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100