Comment 6 for bug 805805

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

The way I discovered it is as follows:

1. I did a strace while sending STOP/CONT signals, here is the strace https://gist.github.com/d5deace9f70fc0514083

        I compared it to strace for MySQL 5.5.22, and I noticed that there is a shutdown(2) which is called for the new-sock spawned for the new connection -- https://gist.github.com/d5deace9f70fc0514083#gistcomment-305803

2. Next, I did gdb attach for the same process, with same STOP/CONT signals and mysql client; here is the gdb backtrace -- https://gist.github.com/c4a76c2342c50088d6bd

3. Next, I did stepping inside do_handle_one_connection and noticed

      3.1

  for (;;)
  {
    bool rc;
    bool create_user= TRUE;

    rc= thd_prepare_connection(thd);
    if (rc)
    {
      create_user= FALSE;
      goto end_thread;
    }

    while (thd_is_connection_alive(thd))
    {
      mysql_audit_release(thd);
      if (do_command(thd)) ------> it returned here and caused it to return on signal
 break;
    }

4. So, I compared the code, between PS and MySQL, for functions do_command calls, and noticed the diff -- !defined(NO_ALARM) -- which I have posted as difference.

5. Tested it with the change and it seems to work.