Hi Baptiste,

On Sun, Jan 24, 2016 at 09:01:27PM +0100, Baptiste wrote:
> I commented this case in the code:
> 
> /* apply drain mode if server is currently enabled */
> if (!(srv->admin & SRV_ADMF_FMAINT) && (srv_admin_state & SRV_ADMF_FDRAIN)) {
>          /* The SRV_ADMF_FDRAIN flag is inherited when srv->iweight is 0
>           * (srv->iweight is the weight set up in configuration)
>           * so we don't want to apply it when srv_iweight is 0 and
>           * srv->iweight is greater than 0. Purpose is to give the
>           * chance to the admin to re-enable this server from configuration
>           * file by setting a new weight > 0.
>           */
>          if ((srv_iweight == 0) && (srv->iweight > 0)) {
>                   srv_adm_set_drain(srv);
>          }
> }
> 
> srv_iweight, taken from the state file, must be 0 and iweight provided
> by the configuration must be greater than 0 to apply the FDRAIN mode.
> 
> So I would say yes, we may not be applying the DRAIN state set up by
> the 'set server state drain' command.
> I have to dig into that one.

But as I said, from what I remember, the main issue is that if the server
is put into drain mode from the agent or the CLI, there's no way from the
config to revert this for now. If later we support startup options to
ignore part of the state files, that may be useful, but for now the risk
is that someone doing a mistake doesn't know how to cancel it even by
restarting.

BTW, maybe we should provide this cmd line option, then it will be possible
to state that a service reload maintain the states and that a service
restart drops them. That would make sense I think.

Willy


Reply via email to