← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 2b3bffb: MDEV-8491 - On shutdown, report the user and the host executed that.

 

Hi, Sergey!

On Nov 26, Sergey Vojtovich wrote:
> > > +
> > > +  if ((user= my_strdup(user_host_buff, MYF(0))) &&
> > > +      !my_atomic_casptr((void **) &shutdown_user,
> > > +                        (void **) &expected_shutdown_user, user))
> > > +    my_free(user);
> > > +}
> > 
> > Interesting. Why is that?
> It supposed to be safe concurrent shutdown.

Okay, but please add a comment about it.

> > > @@ -1888,7 +1912,13 @@ static void __cdecl kill_server(int sig_ptr)
> > >    if (sig != 0) // 0 is not a valid signal number
> > >      my_sigset(sig, SIG_IGN);                    /* purify inspected */
> > >    if (sig == MYSQL_KILL_SIGNAL || sig == 0)
> > > -    sql_print_information(ER_DEFAULT(ER_NORMAL_SHUTDOWN),my_progname);
> > > +  {
> > > +    char *user= (char *) my_atomic_loadptr((void**) &shutdown_user);
> > > +    sql_print_information(ER_DEFAULT(ER_NORMAL_SHUTDOWN), my_progname,
> > > +                          user ? user : "unknown");
> > 
> > can it, really, be "unknown" here? when?
> Yes, in a few cases. E.g. killed by signal. 

Oh, right, sorry. I thought that if() filters that out (because signals
have a special message ER_DEFAULT(ER_GOT_SIGNAL) below).

Any other cases? Otherwise I'd suggest

-               user ? user : "unknown");
+               user ? user : STRINGIFY_ARG(MYSQL_KILL_SIGNAL))

Regards,
Sergei


Follow ups

References