[Mono-dev] [PATCH] XSP: FastCGI Backend should handle unmanaged socket error 10038 on close

Tiaan Geldenhuys tagdev at gmail.com
Sat Feb 20 16:30:49 EST 2010


[Reposting -- should have done it earlier. The mailing-list servers were
weird over new-year's weekend, since it told me I was sending emails from
the future; now actually being in the future, I hope that resending emails
from the past is okay.]


The attached patch prevents the following error from showing up in the XSP
FastCGI Backend's error log, which seems to be harmless but it happens on
every web request since 2.6 when using the UnmanagedSocket implementation:
   "Failed to process connection. Reason: The descriptor is not a socket"
These errors happen after the requests are completely handled, so they don't
really interfere too much except maybe for slowing things down with the
extra exception processing and the growing log file.

I suspect that some of the underlying socket code might have changed between
Mono 2.4.x and 2.6.x (perhaps with "shutdown" from the "libc" DllImport, or
maybe with "close"), since I did not notice these errors previously (even
with an equivalent of r146575-r146577 applied to 2.4.3).  Or maybe the older
versions did not use UnmanagedSocket by default (since StandardSocket works
fine), though I did not change the configuration.  However, I didn't look
much more into this.  For the record, the stack trace of the error is as
follows...
System.Net.Sockets.SocketException: The descriptor is not a socket
  at Mono.FastCgi.UnmanagedSocket.Close () [0x00000] in <filename unknown>:0
  at Mono.FastCgi.Connection.Run () [0x00000] in <filename unknown>:0
  at Mono.FastCgi.Server.OnAccept (IAsyncResult ares) [0x00000] in <filename
unknown>:0


Marek, would you please verify or commit the patch?  Or does this point to a
more serious issue elsewhere, since it happens so frequently?

Regards,
Tiaan.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mono-WebServer-FastCgi_UnmanagedSocket-Close-error_xsp-trunk.patch
Type: application/octet-stream
Size: 727 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100220/dc12079f/attachment.obj 


More information about the Mono-devel-list mailing list