I have a file server written in J6.02.  It works most of the time - for 
thousands of transactions - and then locks up.  I have tracked it down 
to a missing event.  At the point of failure:

there is one socket, and that is the socket I am listening on.  It is 
marked asynchronous;

the socket shows up as readable in sdselect'' (indicating pending 
connection);

if I issue   socket_handler ''   from the keybosrd the system will start 
up again and run fine.


Apparently an FD_ACCEPT event has been lost.



At this point I will have to build a large load-generating setup to 
create enough traffic to fail.  I would prefer to troubleshoot this from 
the source code, so I am asking for someone with access to the source 
for 6.02 j.exe to send me the relevant modules for inspection, or to see 
if they can find a problem in the area.  (My understanding is that the 
source for this bit is not open-source).



Below is the relevant part of my socket system.  I'm including it just 
to show that what I'm doing is simple and robust.  The listening socket 
is handled in the last 2 lines of socket_handler, which calls the recv 
verb to do the accept.  When the system is locked up, socklist has one 
atom, as does sockobj (and they are correct - remember, a manual call to 
socket_handler gets things moving again)

socket_handler =: 3 : 0
NB. Look for a writable socket with space
if. #wsocklist do.
   'v r w e' =. sdselect_jsocket_ ($0);wsocklist;($0);0
   done =. $0
   for_l. sockobj {~ socklist i. w do.  done =. done , 0 = send__l '' end.
   wsocklist =: wsocklist -. done # w
end.
'v r w e' =. sdselect_jsocket_ socklist;($0);($0);0
for_l. sockobj {~ socklist i. r do. recv__l '' end.
)

recv =: 3 : 0
NB. sock is the socket number for the object
if. 0 = 0 {:: 'r c' =. sdaccept_jsocket_ sock do.
NB. this part configures the clone socket, not part of the problem
   if. #callback do. cloneinfo =: cloneinfo callback~ c end.
   o =. conew > {. cloneinfo
   c create__o }. cloneinfo
end.
''
)


Henry Rich
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to