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/03/03 12:34:45 UTC

[Bug 56190] Connection keep-alive not working with asynchronous servlet

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

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

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

--- Comment #7 from Konstantin Kolinko <kn...@gmail.com> ---
1. I agree that "closing the response that was used to initialize this
AsyncContext." seems to be missing from AsyncContextImpl.complete()

[[[
 request.getCoyoteRequest().action(ActionCode.COMMIT, null);
 request.getCoyoteRequest().action(ActionCode.ASYNC_COMPLETE, null);
 clearServletRequestResponse();
]]]


2. It is unclear whether this "commit" and "closing the response" have to occur
before firing onComplete() event or after it.

It it has to be committed before firing and closed after firing, you would get
the chunked response.

To get a non-chunked response, one has to close the response without an
explicit commit. Either (close before firing) or (non commit before firing +
close after firing).

I am reading that onComplete() is designed to allow cleanup of some resources,
so I think that response can be closed before firing. (Though it will break
applications that expect otherwise. Are there are any?)


3. There is a workaround for your example:
Close the response explicitly,
[[[
  response.getWriter().close()
]]]

You should get a non-chunked response this way.

-- 
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