← Back to team overview

maria-developers team mailing list archive

Re: Repeated Error in accept: Bad file descriptor

 

Michael Widenius <monty@xxxxxxxxxxxx> writes:

>>>>>> "Time" == Time Less <timelessness@xxxxxxxxx> writes:
>
> Time> Just thought I'd try out PBXT. I created a database instance with 10
> Time> databases, inside each 100 tables. They were MyISAM tables. Then I did an
> Time> "alter table <name> engine=pbxt" across all of them. That worked fine. Then
> Time> I restarted MySQL, and now it won't come up. Error logs are filled with
> Time> thousands of:
>
> Time> # tail /var/log/mysql.err
> Time> 100713 12:33:33 [ERROR] Error in accept: Bad file descriptor
> Time> 100713 12:33:33 [ERROR] Error in accept: Bad file descriptor
> Time> 100713 12:33:33 [ERROR] Error in accept: Bad file descriptor
>
> Time> To the tune of tens (or hundreds?) per second. I've tried restarting mysqld
> Time> with *ulimit -n 32768* and with my.cnf setting *open_files_limit = 32768* to
> Time> no effect. Does anyone have experience with this? Extensive Google searches
> Time> turn up nothing except esoteric OpenBSD problems or such.

I think it is very likely that you are hitting this bug:

    http://bugs.mysql.com/bug.php?id=48929

The problem is that MySQL/MariaDB is using select() to accept new
connections. But select() has a hard-coded limit of 1024 on the max number of
open files it can support. It seems PBXT uses an open file descriptor per
table, and at startup, this causes the socket used to receive new connections
to be > 1024, causing select() to behave unpredictably.

The bug is apparently only fixed in MySQL 5.5, not MySQL 5.1.

Maybe MariaDB should backport the fix, it is actually a buffer overflow
(though it is hard to see how it could be exploitable), but perhaps more
relevant it is a rather nasty state for the server to get into, and not really
clear how to get it out of it again :-(.

 - Kristian.



References