From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2494 invoked by alias); 25 Sep 2007 14:56:01 -0000 Received: (qmail 2478 invoked from network); 25 Sep 2007 14:55:51 -0000 Received: from unknown (69.17.117.7) by sourceware.org with QMTP; 25 Sep 2007 14:55:51 -0000 Received: (qmail 23407 invoked from network); 25 Sep 2007 14:55:51 -0000 Received: from dsl027-162-100.atl1.dsl.speakeasy.net (HELO otter.localdomain) ([216.27.162.100]) (envelope-sender ) by mail5.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 25 Sep 2007 14:55:50 -0000 Received: from localhost (jmills@localhost) by otter.localdomain (8.11.6/8.11.6) with ESMTP id l8PEtpA12707; Tue, 25 Sep 2007 14:55:51 GMT Date: Tue, 25 Sep 2007 14:56:00 -0000 From: John Mills Reply-To: John Mills To: Alok Singh cc: John Mills , eCos Users In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463810815-1139223673-1190732150=:12695" Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Re: Network TCP Handler: stale socket disposal X-SW-Source: 2007-09/txt/msg00131.txt.bz2 ---1463810815-1139223673-1190732150=:12695 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Content-length: 2460 All - First, please excuse my attaching a patch here, but I would like to respond once (or a few times &8-) in case it's helpful. Second, my reply to Mr. Singh failed posting because it originated from a reader that can't enforce text-only formatting. Sorry. Third, I post this patch for test and discussion purposes. It seems to help in our limited case, but comes with no guarantee. I would appreciate hearing others' experience. Thanks for your patience. - John Mills On Tue, 25 Sep 2007, Alok Singh wrote: > John, > Please post it in whatever form you deem as appropriate.  Let us know > when you will be able to post it. > BTW, I'm seeing a similar issue in my application.  Sockets are > exhausted, and web is not accessible.  Ping is going through. I've kept > Max. number of sockets as 32 while configuring ecos. The strange thing > is that the issue comes after a long period of inactivity, i.e., no web > activity.    > Your patch will be useful. > Regards, > Alok   > ________________________________________ > From: John Mills [mailto:JMills@airdefense.net] > Sent: Tuesday, September 25, 2007 6:56 PM > To: Alok Singh > Cc: ecos-discuss@ecos.sourceware.org > Subject: RE: [ECOS] Re: Network TCP Handler: stale socket disposal > All - > I don't believe my patch was ever accepted. The eCos sources carry a > cautionary note that such a 'hung' socket may have been placed on the > net stack 'accept' queue, and may be in the process of acceptance by a > user thread which could then block. > I checked Linux and FreeBSD man pages on this. In Linux the blocked task > would receive the next such incoming client and be unblocked. This is > perfect for my application. Neither OpenBSD nor FreeBSD man pages > address the issue specifically. > I didn't try to replicate the race condition myself. > eCos now uses an older version of the BSD stack, and updating it looks > significant - well over a month's work, maybe 3 or 4 based on the time > the original author reported for his port. > The patch solved a show-stopping problem with our application and seems > to cause no problems, so we're using it. Two other users tried the > approach and wrote me off-list: in one case it resolved a problem, in > the other it made no difference (either way, as far as I know). I can > share the patch on a "no warranty" basis, but would prefer to post it > appropriately rather than circulating it randomly. >  - John Mills ---1463810815-1139223673-1190732150=:12695 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="uipc_socket_c.pat" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Patch discards stale sockets Content-Disposition: attachment; filename="uipc_socket_c.pat" Content-length: 1233 LS0tIC9vcHQvZWNvcy9lY29zLTIuMC9wYWNrYWdlcy9uZXQvYnNkX3RjcGlw L3YyXzAvc3JjL3N5cy9rZXJuL3VpcGNfc29ja2V0LmMJMjAwMy0wMi0xMiAx MDoyOTo1Mi4wMDAwMDAwMDAgLTA1MDANCisrKyAuL3VpcGNfc29ja2V0LmMJ MjAwNy0wOC0yOCAxNjoxMTo1Ni4wMDAwMDAwMDAgLTA0MDANCkBAIC0yNDIs NiArMjQ2LDExIEBADQogCQkJVEFJTFFfUkVNT1ZFKCZoZWFkLT5zb19pbmNv bXAsIHNvLCBzb19saXN0KTsNCiAJCQloZWFkLT5zb19pbmNxbGVuLS07DQog CQl9IGVsc2UgaWYgKHNvLT5zb19zdGF0ZSAmIFNTX0NPTVApIHsNCisJCQkg aWYoKHNvLT5zb19lcnJvciA9PSBFQ09OTlJFU0VUKSB8fA0KKwkJCQkgKHNv LT5zb19lcnJvciA9PSBFQ09OTlJFRlVTRUQpKXsgLy8gZm9yY2VkIGRyb3Ag aWYgZmxhZ2dlZA0KKwkJCQkgIFRBSUxRX1JFTU9WRSgmaGVhZC0+c29fY29t cCwgc28sIHNvX2xpc3QpOw0KKwkJCQkgIGhlYWQtPnNvX3FsZW4tLTsNCisJ CQkgfSBlbHNlIHsNCiAJCQkvKg0KIAkJCSAqIFdlIG11c3Qgbm90IGRlY29t bWlzc2lvbiBhIHNvY2tldCB0aGF0J3MNCiAJCQkgKiBvbiB0aGUgYWNjZXB0 KDIpIHF1ZXVlLiAgSWYgd2UgZG8sIHRoZW4NCkBAIC0yNDksMTEgKzI1OCwx MyBAQA0KIAkJCSAqIHRoYXQgdGhlIGxpc3RlbmluZyBzb2NrZXQgd2FzIHJl YWR5Lg0KIAkJCSAqLw0KIAkJCXJldHVybjsNCisJCQkgfQ0KIAkJfSBlbHNl IHsNCiAJCQlwYW5pYygic29mcmVlOiBub3QgcXVldWVkIik7DQogCQl9DQog CQloZWFkLT5zb19xbGVuLS07DQogCQlzby0+c29fc3RhdGUgJj0gflNTX0lO Q09NUDsNCisJCXNvLT5zb19zdGF0ZSAmPSB+U1NfQ09NUDsNCiAJCXNvLT5z b19oZWFkID0gTlVMTDsNCiAJfQ0KIAlzYnJlbGVhc2UoJnNvLT5zb19zbmQs IHNvKTsNCg== ---1463810815-1139223673-1190732150=:12695 Content-Type: text/plain; charset=us-ascii Content-length: 148 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ---1463810815-1139223673-1190732150=:12695--