Skip to content
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

EvaluatedDocument.toInputStream usage may result in corrupt documents #34

Closed
mbali opened this issue Jul 14, 2020 · 1 comment · Fixed by #37
Closed

EvaluatedDocument.toInputStream usage may result in corrupt documents #34

mbali opened this issue Jul 14, 2020 · 1 comment · Fixed by #37
Labels
bug Something isn't working

Comments

@mbali
Copy link
Contributor

mbali commented Jul 14, 2020

The EvaluatedDocument.toInputStream function's default implementation uses a PipedInputStream/PipedOutputStream pair, and writes into the output stream in an executor thread. If this write results in an error, the thread reading the input stream will not get notified of the problem, and reads an unfinished and probably corrupt document.

@erdos
Copy link
Owner

erdos commented Jul 15, 2020

Hey, this is a good catch.

Temporary solution is to use EvaluatedDocument.writeToStream(OutputStream outputStream) to render the document.

I will take a look at how we could change toInputStream to propagate any errors that happens during the rendering.
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants