List:Internals« Previous MessageNext Message »
From:Paul McCullagh Date:June 25 2007 4:45pm
Subject:Re: MySQL forces engine shutdown, and hangs
View as plain text  
Hi All,

I have found out why I was getting "Plugin 'PBXT' will be forced to  
shutdown" (the plug-in had a reference to itself).

However, I still have the problem that the server sometimes hangs on  
shutdown.

It hangs after:

070625 15:50:40 [Note] bin/mysqld: Shutdown complete

and after:

bin/mysqladmin -u root shutdown

has exited!

I have tracked this down, to the select() call done by the main thread:

if (select((int) max_used_connection,&readFDs,0,0,0) < 0)

in handle_connections_sockets().

The main thread is hanging in the select() call, while all other  
threads have quit.

So my question: what code is actually responsible for knocking the  
main thread out of the select()?

I don't think signal_hand() is supposed to do this, because it does  
not call pthread_kill().

I suspect close_connections() is supposed to do it, by calling:

shutdown(ip_sock, SHUT_RDWR) and shutdown(unix_sock, SHUT_RDWR)

But this does not always cause select() to return, even though the  
select() is being done on those 2 sockets.

And it is strange that I only have this problem when I install a plug- 
in.

Any help would be welcome!

Thanks,

Paul


On Jun 22, 2007, at 1:40 PM, Paul McCullagh wrote:

> Hi All,
>
> Running with the MySQL 5.1.19 (Linux) I am getting some strange  
> behavior on shutdown:
>
> If I start MySQL, do a SELECT on a PBXT table, and then shutdown  
> MySQL, I get the following:
>
> 070622 13:19:17 [Note] Event Scheduler: Purging the queue. 0 events
> 070622 13:19:17  InnoDB: Starting shutdown...
> 070622 13:19:19  InnoDB: Shutdown completed; log sequence number 0  
> 46409
> 070622 13:19:19 [Warning] Forcing shutdown of 1 plugins
> 070622 13:19:19 [Note] Plugin 'PBXT' will be forced to shutdown
> 070622 13:19:19 [Note] PrimeBase XT Engine shutdown...
> 070622 13:19:19 [Note] libexec/mysqld: Shutdown complete
>
> Why is MySQL forced to shutdown PBXT?
>
> Is there something I can do to have MySQL shutdown PBXT "normally"?
>
> After this, MySQL hangs sometimes, with the following threads active:
>
> (gdb) info threads
>   2 Thread 1152089008 (LWP 25195)  0xffffe410 in ?? ()
>   1 Thread 1076666144 (LWP 25185)  0xffffe410 in ?? ()
> (gdb) thread 1
> [Switching to thread 1 (Thread 1076666144 (LWP 25185))]#0   
> 0xffffe410 in ?? ()
> (gdb) where
> #0  0xffffe410 in ?? ()
> #1  0xbfdf6cc8 in ?? ()
> #2  0x00000000 in ?? ()
> #3  0xbfdf6bd8 in ?? ()
> #4  0x4020ef61 in ___newselect_nocancel () from /lib/tls/libc.so.6
> #5  0x08224d26 in handle_connections_sockets (arg=0x0) at mysqld.cc: 
> 4388
> #6  0x0822a297 in main (argc=2, argv=0xbfdf6da4) at mysqld.cc:3909
> (gdb) thread 2
> [Switching to thread 2 (Thread 1152089008 (LWP 25195))]#0   
> 0xffffe410 in ?? ()
> (gdb) where
> #0  0xffffe410 in ?? ()
> #1  0x44ab7374 in ?? ()
> #2  0x00000000 in ?? ()
> #3  0x00000000 in ?? ()
> #4  0x4004365e in do_sigwait () from /lib/tls/libpthread.so.0
> #5  0x400436ff in sigwait () from /lib/tls/libpthread.so.0
> #6  0x0822a67b in signal_hand (arg=0x0) at mysqld.cc:2434
> #7  0x4003d297 in start_thread () from /lib/tls/libpthread.so.0
> #8  0x4021637e in clone () from /lib/tls/libc.so.6
> #9  0x44ab7bb0 in ?? ()
>
> This is running with PBXT 0.9.86, which did not have this problem  
> in MySQL 5.1.16.
>
> If I don't do the SELECT, MySQL shuts down normally.
>
> Any ideas would be welcome.
>
> Thanks,
>
> Paul
>
>
>
>
> -- 
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    http://lists.mysql.com/internals? 
> unsub=paul.mccullagh@stripped
>

Thread
MySQL forces engine shutdown, and hangsPaul McCullagh22 Jun
  • Re: MySQL forces engine shutdown, and hangsPaul McCullagh25 Jun
    • Re: MySQL forces engine shutdown, and hangsKonstantin Osipov25 Jun