You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Konstantin Preißer <ve...@t-online.de> on 2012/02/20 18:45:47 UTC

ISAPI errors 87 when disabling IIS 7.0's response buffering

Hi all,

I'm using Tomcat 7.0.25 (running on a Oracle JDK 1.7.0_03) on a Windows Server 2008 (32-Bit), with IIS 7.0 and the ISAPI 1.2.32 connector (with chunked encoding enabled) to pass HTTP requests to Tomcat.


Since IIS 7.0, there is a response buffering that also applies to responses from the ISAPI redirector.
This means that even when I call flush() on the Servlet's OutputStream, the previous content is not sent to the user, until IIS's response buffer is full.

However, as I don't want this behavior (when I call flush(), I'd like the response to be immediately sent to the client), I found a way to disable the response buffer, by running the command:

appcmd set config "myhostname.com" /section:handlers -[name='ISAPI-dll'].ResponseBufferLimit:1

This will set the response buffer size to 1 byte for the virtual host "myhostname.com". I can't use 0, as this causes problems with 4xx/5xx status codes (where IIS uses its own error pages), so I'm using 1 here. Now when I send some bytes to the response and then flush(), the bytes will immediately be sent to the client (as it was in IIS 6).

However, now I also get errors in the ISAPI log, like these:

[Sun Feb 19 22:31:05.885 2012] [11976:8708] [error] isapi_write_client::jk_isapi_plugin.c (1250): WriteClient failed with 87 (0x00000057)
[Sun Feb 19 23:57:24.820 2012] [11976:3004] [error] iis_write::jk_isapi_plugin.c (1337): Vector write of chunk encoded response failed with 87 (0x00000057)
[Mon Feb 20 00:13:10.128 2012] [11976:10244] [error] iis_write::jk_isapi_plugin.c (1337): Vector write of chunk encoded response failed with 1229 (0x000004cd)

I suppose this is because some clients abort the connection, before the response could be fully sent. When IIS response buffering was enabled, probably the ISAPI connector didn't see the errors as IIS mostly consumed the whole output before sending anything to the client (as with IIS 6.0, I also regularly got such errors, but with error number 10053).

However, I'm a bit worried about the error number 87, as some sites say about Winsock error 87:
  "Winsock error 87. WSA_INVALID_PARAMETER - One or more parameters are invalid."
(when it says, some parameters are invalid, it sounds like there is an unexpected error here).

Normally, when a client aborted the TCP connection, I would get a 10053 or 995 error.
Are the errors 87 and 1229 expected in such cases?


Thanks!

Best Regards,
Konstantin Preißer


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


RE: ISAPI errors 87 when disabling IIS 7.0's response buffering

Posted by Konstantin Preißer <ve...@t-online.de>.
Hello Rainer,

> -----Original Message-----
> From: Rainer Jung [mailto:rainer.jung@kippdata.de]
> Sent: Monday, February 20, 2012 7:48 PM
> 
> I don't really know, but 1220 is ERROR_CONNECTION_INVALID, which is
> closer to what you expected. One of the parameters passed to
> WriteClient
> and also in the vector write case is actually the connection ID so it
> could be that a unusable client connection could also return "87".
> Unfortunately MSDN doesn't have any useful information.
> 
> Maybe Mladen or Tim know more about it.
> 
> Regards,
> 
> Rainer
> 

Thank you for your reply.

I see that MSDN says about Winsock error 87:

WSA_INVALID_PARAMETER - 87

One or more parameters are invalid.
    An application used a Windows Sockets function which directly maps to a Windows function. The Windows function is indicating a problem with one or more parameters. Note that this error is returned by the operating system, so the error number may change in future releases of Windows.

So I guess the 87 errors correspond to the 1229 errors (when the connection is invalid).

Thanks!

Regards, 
Konstantin Preißer


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


Re: ISAPI errors 87 when disabling IIS 7.0's response buffering

Posted by Rainer Jung <ra...@kippdata.de>.
On 20.02.2012 18:45, Konstantin Preißer wrote:
> Hi all,
>
> I'm using Tomcat 7.0.25 (running on a Oracle JDK 1.7.0_03) on a Windows Server 2008 (32-Bit), with IIS 7.0 and the ISAPI 1.2.32 connector (with chunked encoding enabled) to pass HTTP requests to Tomcat.
>
>
> Since IIS 7.0, there is a response buffering that also applies to responses from the ISAPI redirector.
> This means that even when I call flush() on the Servlet's OutputStream, the previous content is not sent to the user, until IIS's response buffer is full.
>
> However, as I don't want this behavior (when I call flush(), I'd like the response to be immediately sent to the client), I found a way to disable the response buffer, by running the command:
>
> appcmd set config "myhostname.com" /section:handlers -[name='ISAPI-dll'].ResponseBufferLimit:1
>
> This will set the response buffer size to 1 byte for the virtual host "myhostname.com". I can't use 0, as this causes problems with 4xx/5xx status codes (where IIS uses its own error pages), so I'm using 1 here. Now when I send some bytes to the response and then flush(), the bytes will immediately be sent to the client (as it was in IIS 6).
>
> However, now I also get errors in the ISAPI log, like these:
>
> [Sun Feb 19 22:31:05.885 2012] [11976:8708] [error] isapi_write_client::jk_isapi_plugin.c (1250): WriteClient failed with 87 (0x00000057)
> [Sun Feb 19 23:57:24.820 2012] [11976:3004] [error] iis_write::jk_isapi_plugin.c (1337): Vector write of chunk encoded response failed with 87 (0x00000057)
> [Mon Feb 20 00:13:10.128 2012] [11976:10244] [error] iis_write::jk_isapi_plugin.c (1337): Vector write of chunk encoded response failed with 1229 (0x000004cd)
>
> I suppose this is because some clients abort the connection, before the response could be fully sent. When IIS response buffering was enabled, probably the ISAPI connector didn't see the errors as IIS mostly consumed the whole output before sending anything to the client (as with IIS 6.0, I also regularly got such errors, but with error number 10053).
>
> However, I'm a bit worried about the error number 87, as some sites say about Winsock error 87:
>    "Winsock error 87. WSA_INVALID_PARAMETER - One or more parameters are invalid."
> (when it says, some parameters are invalid, it sounds like there is an unexpected error here).
>
> Normally, when a client aborted the TCP connection, I would get a 10053 or 995 error.
> Are the errors 87 and 1229 expected in such cases?

I don't really know, but 1220 is ERROR_CONNECTION_INVALID, which is 
closer to what you expected. One of the parameters passed to WriteClient 
and also in the vector write case is actually the connection ID so it 
could be that a unusable client connection could also return "87". 
Unfortunately MSDN doesn't have any useful information.

Maybe Mladen or Tim know more about it.

Regards,

Rainer


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