You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Julian Sedding <js...@gmail.com> on 2018/11/26 09:32:21 UTC

[DISCUSS] SLING-8047 - auto-flush response in SlingRequestProcessorImpl

Hi all

TL;DR I'm looking for feedback regarding a proposed fix in a central
code-path of SlingRequestProcessorImpl.

In SLING-8047, Phlip Mundt raised an issue where he observed that the
output of responses rendered using SlingRequestProcessorImpl were
empty.

It turns out that the OutputStream or Writer of the response are not
flushed once processing is complete. I assume that for normal
rendering that is not an issue, because the HttpService (servlet
container) would flush the response. However, when directly using
SlimgRequestProcessor, the response is NOT flushed at the end of
request processing.

I propose flushing the response in SlingRequestProcessorImpl after
processing is complete (see [0]). I don't expect this to cause any
issues when run in a servlet container either, because the response
woudl just get flushed again (which is likely a no-op).

Does anyone have concerns regarding this proposed fix?

Regards
Julian

[0] https://github.com/jsedding/sling-org-apache-sling-engine/commit/1b01408724238e1c234d547af25a921495d8f779

Re: [DISCUSS] SLING-8047 - auto-flush response in SlingRequestProcessorImpl

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Mon, Nov 26, 2018 at 10:32 AM Julian Sedding <js...@gmail.com> wrote:
> ...Does anyone have concerns regarding this proposed fix?..

Not me, your fix looks reasonable.

-Bertrand

Re: [DISCUSS] SLING-8047 - auto-flush response in SlingRequestProcessorImpl

Posted by Jason E Bailey <je...@apache.org>.
+1 no concerns

- Jason

On Mon, Nov 26, 2018, at 4:32 AM, Julian Sedding wrote:
> Hi all
> 
> TL;DR I'm looking for feedback regarding a proposed fix in a central
> code-path of SlingRequestProcessorImpl.
> 
> In SLING-8047, Phlip Mundt raised an issue where he observed that the
> output of responses rendered using SlingRequestProcessorImpl were
> empty.
> 
> It turns out that the OutputStream or Writer of the response are not
> flushed once processing is complete. I assume that for normal
> rendering that is not an issue, because the HttpService (servlet
> container) would flush the response. However, when directly using
> SlimgRequestProcessor, the response is NOT flushed at the end of
> request processing.
> 
> I propose flushing the response in SlingRequestProcessorImpl after
> processing is complete (see [0]). I don't expect this to cause any
> issues when run in a servlet container either, because the response
> woudl just get flushed again (which is likely a no-op).
> 
> Does anyone have concerns regarding this proposed fix?
> 
> Regards
> Julian
> 
> [0] 
> https://github.com/jsedding/sling-org-apache-sling-engine/commit/1b01408724238e1c234d547af25a921495d8f779