On Fri, Dec 20, 2013 at 9:29 AM, Steven <mailparmalat@gmail.com> wrote:
Hi all,

We are running Yaws 1.96 on Erlang 15B03-1 for hosting and experienced this continuously in the nohup file. 

=ERROR REPORT==== 4-Dec-2013::11:52:31 ===
Unhandled reply fr. do_recv() {error,ebadf}

=ERROR REPORT==== 4-Dec-2013::11:52:31 ===
Unhandled reply fr. do_recv() {error,ebadf}

=ERROR REPORT==== 4-Dec-2013::12:01:06 ===
Unhandled reply fr. do_recv() {error,ebadf} 

The ebadf almost certainly comes from trying to recv from an already-closed socket.

Eventually the Yaws server process terminates and crashes the runtime. 

=ERROR REPORT==== 18-Dec-2013::17:42:13 ===
yaws: Failed to accept - terminating: {error,system_limit}

=ERROR REPORT==== 18-Dec-2013::17:42:13 ===
Accept proc died, terminate gserv
=ERROR REPORT==== 18-Dec-2013::17:42:13 ===
yaws: FATAL gserv died noserver
 
The Yaws server terminated as it couldn't create more ports but the runtime was servicing minimal traffic, less than 1 per second requests at that time. The number of file descriptors is 1024. The machine doesn't have a lot of occupied ports. 

After restarting the runtime and left it running for a day, the number of ports remained relatively constant.

Doing lsof -a -p results in less than 50 items (including files and ports)

length(erlang:ports()).
31

Has anyone come across the error "Unhandled reply fr. do_recv() {error,ebadf}" and as well as reaching maximum port allocation when traffic is very little? I'm hoping there isn't a 'leaking' port or file descriptor somewhere.

I've never seen this issue before, but it would be interesting to see what erlang:ports() shows while you're getting those errors. How hard is it to recreate this problem?

--steve