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

Warnings for closed output stream in logs #899

Closed
rabidllama opened this issue Apr 12, 2021 · 0 comments · Fixed by #911
Closed

Warnings for closed output stream in logs #899

rabidllama opened this issue Apr 12, 2021 · 0 comments · Fixed by #911
Assignees

Comments

@rabidllama
Copy link
Contributor

Here's what I did

Built a container and made requests whilst using production level logging. All requests made result in a lengthy output to the logs.


Here's what I got

Warnings are being logged as apparently the response stream has already been closed. This does not show in debug level debugging as the springframework loglevel there is set to error, whereas in the production it is set to warning (so production actually logs more than the debug?)

12 Apr 12:20:33 WARN [annotation.ExceptionHandlerExceptionResolver] - Failure in @ExceptionHandler org.heigit.ors.api.controllers.RoutingAPI#handleReadingBodyException(Exception)
java.io.IOException: Cannot write to a closed output stream
	at org.heigit.ors.servlet.filters.GZIPResponseStream.write(GZIPResponseStream.java:86) ~[classes/:6.4.1]
	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233) ~[?:?]
	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:312) ~[?:?]
	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:316) ~[?:?]
	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:153) ~[?:?]
	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:254) ~[?:?]
	at org.springframework.util.StreamUtils.copy(StreamUtils.java:148) ~[spring-core-5.2.10.RELEASE.jar:5.2.10.RELEASE]

Here's what I was expecting

That there are no warnings produced from Spring when making requests


Here's what I think could be improved

Investigate why the corresponding stream is being closed before it should be, or why it is being used in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants