[PATCH] upstream keepalive: save and restore connection data

Maxim Dounin mdounin at mdounin.ru
Sun May 1 15:53:27 UTC 2022


Hello!

On Sun, May 01, 2022 at 07:46:05AM +0500, RekGRpth wrote:

> now, for example, I do very dirty hack for this:
> https://github.com/RekGRpth/ngx_pg_module/blob/06eab53160fcff2b19e73ed5bc787f534c2a4c2e/ngx_pg_module.c#L1382-L1385
> for save and https://github.com/RekGRpth/ngx_pg_module/blob/06eab53160fcff2b19e73ed5bc787f534c2a4c2e/ngx_pg_module.c#L1362
> for restore

As far as I understand, the module in question misuses parts of 
the upstream infrastructure, notably upstream blocks and 
balancers, for its own needs.  It looks somewhat strange to me to 
request changes in the infrastructure which corresponds to the 
misuse in question and not the use of the infrastructure in the 
upstream module itself.

Either way, a better and well supported approach to save any 
connection-specific data within a cached connection would be to do 
so via a connection's pool cleanup, see gRPC proxy module for an 
example:

http://hg.nginx.org/nginx/file/a736a7a613ea/src/http/modules/ngx_http_grpc_module.c#l4196

Hope this helps.

-- 
Maxim Dounin
http://mdounin.ru/



More information about the nginx-devel mailing list