felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-4840) Asynchronous IO fails in webconsole plugin
Date Thu, 02 Apr 2015 06:01:52 GMT

    [ https://issues.apache.org/jira/browse/FELIX-4840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14392201#comment-14392201

Carsten Ziegeler commented on FELIX-4840:

isAsyncSupported returning true is not a problem/bug of the web console; this is more a problem
of the http service implementation. I assume you're using an implementing embedding Jetty
(like the Apache Felix one). Jetty always returns true. We are currently working on an update
of the Felix implementation handling this correctly and ignoring the value from Jetty.
I agree that if your web console plugin wants to use async support, we maybe should change
the webconsole implementation as well

> Asynchronous IO fails in webconsole plugin
> ------------------------------------------
>                 Key: FELIX-4840
>                 URL: https://issues.apache.org/jira/browse/FELIX-4840
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>    Affects Versions: webconsole-4.2.8
>            Reporter: Balazs Zsoldos
> *Issue*
> The following function call always returns with true:
> {code:java}
> ServletRequest.isAsyncSupported()
> {code}
> However, async calls fail even if the webconsole plugin tries to provide some resource
(with some special extension on the end of the URI).
> *Reason*
> In the end of the _OSGiManager.service(ServletRequest, ServletResponse)_ function, there
is the following:
> {code:java}
>         // ensure response has been sent back and response is committed
>         // (we are authorative for our URL space and no other servlet should interfere)
>         res.flushBuffer();
> {code}
> Due to the reason that _flushBuffer()_ function is called, any asynchronous handling
will fail with an exception.
> *Proposed solution*
>  - In case the webconsole plugin is rendered (the path ends with / or .html), the _request.isAsyncSupported()_
method call should return false
>  - In case a custom resource is provided by the webconsole plugin (any extension but
html on the end of the path) the _flushBuffer()_ method should not be called
> At least the second part of the fix should be implemented as if a plugin wants to provide
bigger files (like a dump), async support can be useful. Also, by the time more and more libraries
will support asynchronous IO to provide resources and if a webconsole plugin uses such library,
it will fail.

This message was sent by Atlassian JIRA

View raw message