Auto-closing InputStream in Response.readEntity can break the client code reading DOM Document or JAXP Source
- Dominant language
- Java
- Stars
- 400
- Forks
- 143
- PR merge metrics
- No merged PRs in 30d
Description
Hi, after we implemented an auto-closing of InputStream in Response.readEntity we started seeing random failures. For example, CXF tests where we had Response.readEntity(StreamSource.class) was passing OK on two branches but was failing on the 3rd one. One DOM-based tests started failing as well.
Took a bit of time to figure out it was to do with closing the stream too early in those cases.
Proposal: either completely disallow the auto-closing of InputStream or make it conditional (example, based on some property, etc)
#### Affected Versions
[2.0]
Contributor guide
Research direction
Start with the Response.readEntity behavior that closes the InputStream, then reproduce the reported StreamSource and DOM-based failures from the CXF tests. Determine whether the supported fix is to remove or conditionally control auto-closing; done means those entity reads no longer fail under the chosen policy and regression coverage is added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100