-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streams fetched by data-providers are never closed #18551
Comments
mcollovati
moved this from 🆕 Needs triage
to 🔖 Normal Priority (P2)
in Vaadin Flow bugs & maintenance (Vaadin 10+)
Jan 30, 2024
mcollovati
pushed a commit
that referenced
this issue
Jan 30, 2024
Fixes DataCommunicator API by handling the streams fetched from data-providers inside try-with-resources blocks. Unclosed streams might still leak from the DataView API, that should be fixed in each component using that API. Fixes #18551
github-project-automation
bot
moved this from 🔖 Normal Priority (P2)
to ✅ Closed
in Vaadin Flow bugs & maintenance (Vaadin 10+)
Jan 30, 2024
github-project-automation
bot
moved this from ⚒️ In progress
to Done
in Vaadin Flow ongoing work (Vaadin 10+)
Jan 30, 2024
vaadin-bot
pushed a commit
that referenced
this issue
Jan 30, 2024
Fixes DataCommunicator API by handling the streams fetched from data-providers inside try-with-resources blocks. Unclosed streams might still leak from the DataView API, that should be fixed in each component using that API. Fixes #18551
vaadin-bot
added a commit
that referenced
this issue
Jan 30, 2024
Fixes DataCommunicator API by handling the streams fetched from data-providers inside try-with-resources blocks. Unclosed streams might still leak from the DataView API, that should be fixed in each component using that API. Fixes #18551 Co-authored-by: Giovanni Lovato <[email protected]>
This ticket/PR has been released with Vaadin 24.3.4. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the bug
Let’s say I have a backend data-provider for a stream of strings read from a
BufferedReader
, e.g.In this case I want to be sure to close the reader when the stream reaches a terminal operation, so I do
onClose(reader::close)
. Problem is, when theDataCommunicator
gets that stream:flow/flow-data/src/main/java/com/vaadin/flow/data/provider/DataCommunicator.java
Line 1055 in b8a992a
then it is never closed. This also applies to the
DataView
API, e.g.flow/flow-data/src/main/java/com/vaadin/flow/data/provider/AbstractDataView.java
Lines 153 to 155 in b8a992a
Expected behavior
Upon calling terminal operations, the stream is then closed.
Minimal reproducible example
See code snippet in the description above.
Versions
The text was updated successfully, but these errors were encountered: