From: Tad <ecos_removethispart@ds3switch.com>
To: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Re: accept() FreeBSD hangs when out of resources
Date: Tue, 12 Jun 2007 03:57:00 -0000 [thread overview]
Message-ID: <466DE365.1090800@ds3switch.com> (raw)
In-Reply-To: <20070611230045.GI26816@lunn.ch>
Andrew Lunn wrote:
> On Mon, Jun 11, 2007 at 03:42:07PM -0800, Tad wrote:
>
>>>> accept() won't return and won't timeout (>12hrs) when listen() indicates
>>>> a new connection, if out of sockets/file-descriptors and all TCP
>>>> connections are in ESTABLISHED state.
>>>>
>>> Where exactly is it blocked. Please could you provide a call stack.
It's possible that the block is somewhere such as this "FIXME" code that
wasn't finished in sys/kern/sockio.c
/*
348 * At this point we know that there is at least one connection
349 * ready to be accepted. Remove it from the queue prior to
350 * allocating the file descriptor for it since falloc() may
351 * block allowing another process to accept the connection
352 * instead.
353 */
354 so = TAILQ_FIRST(&head->so_comp);
355 TAILQ_REMOVE(&head->so_comp, so, so_list);
356 head->so_qlen--;
357
358 #if 0 // FIXME
359 fflag = lfp->f_flag;
360 error = falloc(p, &nfp, &fd);
361 if (error) {
362 /*
363 * Probably ran out of file descriptors. Put the
364 * unaccepted connection back onto the queue and
365 * do another wakeup so some other process might
366 * have a chance at it.
367 */
368 TAILQ_INSERT_HEAD(&head->so_comp, so, so_list);
369 head->so_qlen++;
370 wakeup_one(&head->so_timeo);
371 splx(s);
372 goto done;
373 }
374 fhold(nfp);
375 p->p_retval[0] = fd;
376
377 /* connection has been removed from the listen queue */
378 KNOTE(&head->so_rcv.sb_sel.si_note, 0);
379 #endif
380
381 so->so_state &= ~SS_COMP;
382 so->so_head = NULL;
383
384 cyg_selinit(&so->so_rcv.sb_sel);
385 cyg_selinit(&so->so_snd.sb_sel);
386
387 new_fp->f_type = DTYPE_SOCKET;
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2007-06-11 23:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-11 23:15 Tad
2007-06-12 3:51 ` Andrew Lunn
2007-06-12 3:57 ` Tad [this message]
2007-06-12 6:54 ` Andrew Lunn
2007-06-12 15:37 ` Tad
2007-06-12 15:49 ` Lars Povlsen
2007-06-12 16:08 ` [ECOS] listen (x, 0) on new TCP incoming connections doesn't stop select()/accept() Tad
2007-06-12 4:05 ` [ECOS] Re: Re: accept() FreeBSD hangs when out of resources Tad
2007-06-12 11:06 ` Andrew Lunn
2007-06-12 11:19 ` Andrew Lunn
[not found] ` <466F2FC7.8060704@ds3switch.com>
2007-06-13 0:09 ` [ECOS] "Fix" for atHTTP and HTTP socket requirements with mozilla POSTS Tad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=466DE365.1090800@ds3switch.com \
--to=ecos_removethispart@ds3switch.com \
--cc=ecos-discuss@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).