Tue 05 december 2006 23:55 Claes Wikstrom wrote:
> Hmmm, the (TM) right behaviour if accept fails is ... probably
> to try to accept() again. Anybody's got an opinion on that ?
>
>
> In your case, I think the loop stems from
> fault embedded mode configs. einval is the reason, the args to accept
> are somehow weird.
>
> You need to debug this, stage 1 would be to print out the
> arg to accept()
>
>
> /klacke
Well it is a bit more tricky here.
First:
Everything works fine on R10, but not on R11 (I have only tested R11B on
Sparc-Solaris so far).
Second:
I am not running in embedded mode, instead I first call yaws_api:getconf, and
then I only modify the SConfs part:
insert(Yapps) when is_list(Yapps) ->
{ok, Gconf, Sconfs} = yaws_api:getconf(),
NewSconfs = (catch insert_yapps_in_sconfs(Yapps, Sconfs)),
yaws_api:setconf(Gconf, NewSconfs).
It is gen_tcp:accept(GS#gs.l) in do_accept that returns {errror,einval} and
the argument GS#gs.l is an Erlang port. When things go into spin I can see
that it is called with the same port id all the time, which is logical since
GS do not change in the gserv_loop clause that is used:
{_From, next} when Ready == [] ->
New = acceptor(GS),
gserv_loop(GS, Ready, Rnum, New);
I agree more debugging is needed to get to the root cause though.
/Mikael
|