Re: warning in error_log when using websocket tunnel

2021-02-15 Thread jean-frederic clere

On 12/02/2021 18:09, Yann Ylavic wrote:

On Fri, Feb 12, 2021 at 5:59 PM jean-frederic clere  wrote:


On 12/02/2021 17:34, Ruediger Pluem wrote:


On 2/12/21 5:17 PM, jean-frederic clere wrote:

[]

  do {
  rv = apr_pollset_poll(pollset, timeout, , );
  } while (APR_STATUS_IS_EINTR(rv));
+++

I don't remember why we have the while here...


We ignore EINTR anywhere in the core/network modules (even in the APR).
But what could we do about it, abort everything while it may be a graceful stop?
I think we rely on ungraceful stop to ungracefully stop us..


Is there a way to test why the get the signal in ap_proxy_tunnel_run() and 
react on shutdown command to prevent the warning message?


Maybe we could run ap_mpm_query(AP_MPMQ_MPM_STATE, )
and drop out if result == AP_MPMQ_STOPPING


Yes that works ;-)


But typically the shutdown is graceful in the sense that the request should be 
finished. Maybe a bad idea with long lasting tunnels.


Correct...


I'd rather we let ungraceful stop do its job, and maybe lower the
timeout on AP_MPMQ_STOPPING when (e.g.) ProxyAsyncGracefulTimeout is
configured?

By the way Jean-Frédéric, does this AH00045 happen on graceful or
ungraceful stop/restart, or both?


Only on ungraceful, with the graceful a timeout occurs (we might check 
for timeout to prevent httpd to wait for ever but it seems there is 
always a timeout...)





Regards;
Yann.




--
Cheers

Jean-Frederic


Re: warning in error_log when using websocket tunnel

2021-02-12 Thread Yann Ylavic
On Fri, Feb 12, 2021 at 5:59 PM jean-frederic clere  wrote:
>
> On 12/02/2021 17:34, Ruediger Pluem wrote:
> >
> > On 2/12/21 5:17 PM, jean-frederic clere wrote:
[]
> >>  do {
> >>  rv = apr_pollset_poll(pollset, timeout, , );
> >>  } while (APR_STATUS_IS_EINTR(rv));
> >> +++
> >>
> >> I don't remember why we have the while here...

We ignore EINTR anywhere in the core/network modules (even in the APR).
But what could we do about it, abort everything while it may be a graceful stop?
I think we rely on ungraceful stop to ungracefully stop us..

> >> Is there a way to test why the get the signal in ap_proxy_tunnel_run() and 
> >> react on shutdown command to prevent the warning message?
> >
> > Maybe we could run ap_mpm_query(AP_MPMQ_MPM_STATE, )
> > and drop out if result == AP_MPMQ_STOPPING
>
> Yes that works ;-)
>
> > But typically the shutdown is graceful in the sense that the request should 
> > be finished. Maybe a bad idea with long lasting tunnels.
>
> Correct...

I'd rather we let ungraceful stop do its job, and maybe lower the
timeout on AP_MPMQ_STOPPING when (e.g.) ProxyAsyncGracefulTimeout is
configured?

By the way Jean-Frédéric, does this AH00045 happen on graceful or
ungraceful stop/restart, or both?


Regards;
Yann.


Re: warning in error_log when using websocket tunnel

2021-02-12 Thread jean-frederic clere

On 12/02/2021 17:34, Ruediger Pluem wrote:



On 2/12/21 5:17 PM, jean-frederic clere wrote:

Hi,

I have the warnings in error_log when a web socket is opened at the shutdown 
time:

+++
[Fri Feb 12 16:10:39.243444 2021] [core:warn] [pid 2879580:tid 140162655000576] 
AH00045: child process 2879590 still did not exit,
sending a SIGTERM
[Fri Feb 12 16:10:41.245444 2021] [core:warn] [pid 2879580:tid 140162655000576] 
AH00045: child process 2879590 still did not exit,
sending a SIGTERM
+++

ap_proxy_tunnel_run()

there is:
+++
     do {
     const apr_pollfd_t *results;
     apr_int32_t nresults, i;

     ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r,
   "proxy: %s: polling (client=%hx, origin=%hx)",
   scheme, client->pfd->reqevents, origin->pfd->reqevents);
     do {
     rv = apr_pollset_poll(pollset, timeout, , );
     } while (APR_STATUS_IS_EINTR(rv));
+++

I don't remember why we have the while here...
Is there a way to test why the get the signal in ap_proxy_tunnel_run() and 
react on shutdown command to prevent the warning message?


Maybe we could run ap_mpm_query(AP_MPMQ_MPM_STATE, )
and drop out if result == AP_MPMQ_STOPPING


Yes that works ;-)


But typically the shutdown is graceful in the sense that the request should be 
finished. Maybe a bad idea with long lasting tunnels.


Correct...



Regards

Rüdiger




--
Cheers

Jean-Frederic


Re: warning in error_log when using websocket tunnel

2021-02-12 Thread Ruediger Pluem



On 2/12/21 5:17 PM, jean-frederic clere wrote:
> Hi,
> 
> I have the warnings in error_log when a web socket is opened at the shutdown 
> time:
> 
> +++
> [Fri Feb 12 16:10:39.243444 2021] [core:warn] [pid 2879580:tid 
> 140162655000576] AH00045: child process 2879590 still did not exit,
> sending a SIGTERM
> [Fri Feb 12 16:10:41.245444 2021] [core:warn] [pid 2879580:tid 
> 140162655000576] AH00045: child process 2879590 still did not exit,
> sending a SIGTERM
> +++
> 
> ap_proxy_tunnel_run()
> 
> there is:
> +++
>     do {
>     const apr_pollfd_t *results;
>     apr_int32_t nresults, i;
> 
>     ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r,
>   "proxy: %s: polling (client=%hx, origin=%hx)",
>   scheme, client->pfd->reqevents, origin->pfd->reqevents);
>     do {
>     rv = apr_pollset_poll(pollset, timeout, , );
>     } while (APR_STATUS_IS_EINTR(rv));
> +++
> 
> I don't remember why we have the while here...
> Is there a way to test why the get the signal in ap_proxy_tunnel_run() and 
> react on shutdown command to prevent the warning message?

Maybe we could run ap_mpm_query(AP_MPMQ_MPM_STATE, )
and drop out if result == AP_MPMQ_STOPPING
But typically the shutdown is graceful in the sense that the request should be 
finished. Maybe a bad idea with long lasting tunnels.

Regards

Rüdiger


warning in error_log when using websocket tunnel

2021-02-12 Thread jean-frederic clere

Hi,

I have the warnings in error_log when a web socket is opened at the 
shutdown time:


+++
[Fri Feb 12 16:10:39.243444 2021] [core:warn] [pid 2879580:tid 
140162655000576] AH00045: child process 2879590 still did not exit, 
sending a SIGTERM
[Fri Feb 12 16:10:41.245444 2021] [core:warn] [pid 2879580:tid 
140162655000576] AH00045: child process 2879590 still did not exit, 
sending a SIGTERM

+++

ap_proxy_tunnel_run()

there is:
+++
do {
const apr_pollfd_t *results;
apr_int32_t nresults, i;

ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r,
  "proxy: %s: polling (client=%hx, origin=%hx)",
  scheme, client->pfd->reqevents, 
origin->pfd->reqevents);

do {
rv = apr_pollset_poll(pollset, timeout, , );
} while (APR_STATUS_IS_EINTR(rv));
+++

I don't remember why we have the while here...
Is there a way to test why the get the signal in ap_proxy_tunnel_run() 
and react on shutdown command to prevent the warning message?


--
Cheers

Jean-Frederic