You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/06/18 22:05:53 UTC

[Bug 56640] New: request.isAsyncSupported wrongly returns false

https://issues.apache.org/bugzilla/show_bug.cgi?id=56640

            Bug ID: 56640
           Summary: request.isAsyncSupported wrongly returns false
           Product: Tomcat 7
           Version: 7.0.54
          Hardware: PC
                OS: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: jfarcand@apache.org

This is a hard issue to reproduce, but using 7.0.5x a Servlet defined as:

        <servlet>
                <description>AtmosphereServlet</description>
                <servlet-name>AtmosphereServlet</servlet-name>
                <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet>
                <load-on-startup>1</load-on-startup>
                <async-supported>true</async-supported>
        </servlet>
        <servlet-mapping>
                <servlet-name>AtmosphereServlet</servlet-name>
                <url-pattern>/chat/*</url-pattern>
        </servlet-mapping>

will return request.isAsyncSupported() == false when the client (in the test
Chrome) send a normal http request taking the form of 

T 127.0.0.1:53657 -> 127.0.0.1:8081 [AP]
GET
/chat/company/8?X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=8567472b-c334-4f55-8b6b-f5c3d4763378&X-Atmosphere-WebSocket-Proxy=true&_=1403113561652
HTTP/1.1.
Host: 127.0.0.1:8081.
Connection: keep-alive.
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36.
Content-Type: text/plain.
Accept: */*.
Referer: http://127.0.0.1:8081/.
Accept-Encoding: gzip,deflate,sdch.
Accept-Language: en-US,en;q=0.8,de;q=0.6,fr;q=0.4,nl;q=0.2.
Cookie: nikio.guid=2e87c963-0668-4e2f-8e91-63c2eb759558;
__utma=96992031.807814183.1379458509.1398954177.1398962667.30;
__utmz=96992031.1393253205.21.3.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=http://127.0.0.1:8080/prime-showcase/push/index.jsf;
JSESSIONID=D7F9DEA3D70CB0404F425DC26209520F.
.

This request is send when the browser is about to leave the page, and marked as
blocking, as described here

   http://goo.gl/fQV7Yk

The issue is hard to reproduce, but I can share (privately) a simple
application that will demonstrate the issue (small customer apps).

I do have a workaround in Atmosphere: http://goo.gl/QNavLJ

but that's quite ugly. Note that there is a websocket connection active on the
AtmosphereServlet when the issue arise (I do see the WsFilter in the stack
trace)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56640] request.isAsyncSupported wrongly returns false

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56640

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Please send the app to reproduce this to the Tomcat private list.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56640] request.isAsyncSupported wrongly returns false

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56640

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Mark Thomas <ma...@apache.org> ---
I have been provided with the test case off-line. In the failure scenarios I
observed, and in the example stack traces provided of when the problem
occurred, the request was being routed through a filter that was not marked as
async-supported. Therefore, Tomcat is correctly reporting that async is not
supported for that request.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56640] request.isAsyncSupported wrongly returns false

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56640

--- Comment #3 from Konstantin Kolinko <kn...@gmail.com> ---
For a reference,
some pointers for the current Tomcat 7.0.x code.

1) javax.servlet.ServletRequestWrapper.isAsyncSupported()
returns the value from the wrapped request object.

2) org.apache.catalina.connector.Request.isAsyncSupported()
returns the value of "this.asyncSupported" field.

The default value (null) is interpreted as "true".

3) The o.a.c.connector.Request#asyncSupported field can be set via two APIs:

[A): o.a.c.connector.Request.setAsyncSupported()

(B): via Request$SpecialAttributeAdapter for attribute name
Globals.ASYNC_SUPPORTED_ATTR ("org.apache.catalina.ASYNC_SUPPORTED").

The (A) API is used to propagate isAsyncSupported() value from Valves
(getPipeline().isAsyncSupported()).

The (B) API is used to propagate the value from Filter and Servlet definitions.
See o.a.c.core.ApplicationFilterChain#internalDoFilter(..)

The property update pattern is that if the current value is "true" and the next
Valve, Filter or Servlet does not support async processing, the value is
changed to "false".


The SpecialAttributeAdapter in (B) would better be more robust. It shall
support changing the value to Boolean.FALSE and reject any other value.

Other then that, I do not see any place for an error for the value of
"isAsyncSupported" request attribute.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56640] request.isAsyncSupported wrongly returns false

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56640

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> ---
1. Exact version of Tomcat where this is observed = ?

2. Full stacktrace when the issue happens = ?
You can mask your own components names.
I'd guess that you may have non-async capable filters there.

3. Run with a debugger [1] and look where the "async not supported" condition
is coming from.

[1] http://wiki.apache.org/tomcat/FAQ/Developing#Debugging


Without a reproducing example it is up to you to provide necessary information.


> Note that there is a websocket connection active on the AtmosphereServlet when > the issue arise (I do see the WsFilter in the stack trace)

No. (WsFilter is always there when you have websocket
ServletContainerInitializer active. Details are discussed in issue 55855. You
may get rid of those by removing *websocket* JARs from Tomcat or by some
configuration.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org