Error in accept: Bad file descriptor

1,213 views
Skip to first unread message

Shahrier Akram

unread,
Jun 14, 2016, 6:52:03 PM6/14/16
to Percona Discussion
Recently upgraded to Percona 5.7.12-log on a Debian box and the Percona server's been requiring frequent restarts every few hours to keep working. Further details here in stack overflow:


ulimit is at 64k. It was at 1024 before. Raising the the opens_files_limit appears to have reduced the frequency of outage but not completely unfortunately. Any insights appreciated.

Peter Zaitsev

unread,
Jun 14, 2016, 7:11:42 PM6/14/16
to percona-discussion
Hi,

What do you see as open_files status variable ?  Does it reach any high numbers ? 

--
You received this message because you are subscribed to the Google Groups "Percona Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to percona-discuss...@googlegroups.com.
To post to this group, send email to percona-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Peter Zaitsev, CEO, Percona
Tel: +1 888 401 3401 ext 7360   Skype:  peter_zaitsev



edw...@ehibbert.org.uk

unread,
Oct 7, 2016, 12:37:04 PM10/7/16
to Percona Discussion
I've just upgraded to Percona Cluster 5.7, and I see this too. The server spins logging that error until I manually restart it - which isn't great, so I'll need to rig up a monit script to restart it. It lasts a couple of hours before this happens under normal load.

I've increased the open files limit:

mysql> show global variables like 'open%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| open_files_limit | 100000 |
+------------------+--------+

Immediately after a restart, I see this:

mysql> show status like 'open%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| Open_files | 36 |
| Open_streams | 0 |
| Open_table_definitions | 231 |
| Open_tables | 2157 |
| Opened_files | 834 |
| Opened_table_definitions | 0 |
| Opened_tables | 1 |
+--------------------------+-------+

I don't yet know how this behaves over time, as when it's failed I've immediately panicked and restarted it rather than try to debug it.

edw...@ehibbert.org.uk

unread,
Oct 8, 2016, 5:25:08 AM10/8/16
to Percona Discussion, edw...@ehibbert.org.uk
Well, this is a nice one.

In my case, the tight loop in the server was actually provoked by monit, which connects to 127.0.0.1 to check that the server is up.

If I shut down monit, the mysqld stays up.

If I then telnet localhost 3306 and disconnect, mysqld goes into a tight loop logging [ERROR] Error in accept: Bad file descriptor

Roel Van de Paar

unread,
Oct 10, 2016, 9:09:05 PM10/10/16
to Percona Discussion

Roel Van de Paar

unread,
Oct 10, 2016, 9:10:05 PM10/10/16
to Percona Discussion
If so, we could consider porting the patch.

Edward Hibbert

unread,
Oct 11, 2016, 1:33:46 AM10/11/16
to percona-d...@googlegroups.com
Thanks for your reply.  I don't think it's that - I have 5000 in my.cnf and that's what select @@max_connections\G shows.

As (now) described on http://stackoverflow.com/questions/37796693/mysql-0-error-error-in-accept-bad-file-descriptor/39967997#39967997 I have a hacky workaround by using unix sockets rather than TCP, which enables me to keep my servers running for more than an hour or so :-).   

I've not done work  on the MySQL code so I may be wrong, but the code I've included in that answer does look a bit like it retries in the hope that the problem will go away - which I can believe for EINTR, but doesn't seem to be the case with whatever is going on here.
--
You received this message because you are subscribed to a topic in the Google Groups "Percona Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/percona-discussion/Tu0S2OvYqKA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to percona-discuss...@googlegroups.com.

To post to this group, send email to percona-d...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages