[QUIC] When old worker listen fd detach ebpf reuseport group when reload

Vladimir Homutov vl at nginx.com
Wed Mar 10 07:00:46 UTC 2021


10.03.2021 06:17, Gao,Yan(ACG VCP) пишет:
> Hello Vladimir Homutov,
> 
>>I'm not sure I understand what you are trying to do.
> 
>>Do you have some issues with existing quic implementations in nginx?
> 
> I just want to know how nginx handle old and new quic connections when 
> reload.
> 
> Nginx keep quic connections open when reload to complete old connections.
> 
> But new connections can still be handled by old workers.
> 
> Can the listening fd detach from reuseport group with keeping open, as 
> kernel says, ebpf only look up an unconnected socket for a packet (UDP)
> 
> Gao,Yan(ACG VCP)
> 

Each worker process has it's own socket, identified by SO_COOKIE.
Such sockets belong to same reuseport group. BPF is used to route
packets with the same key (injected into DCID when connection is 
established) to the same socket.

The reload part is not yet complete. New connections may reach old
workers. Since worker knows it is terminating, it will not accept
such connection. Client will retry, and next time it will probably
reach new worker (or the old one again).

You cannot touch old socket, since it is needed to work with existing
connections in old worker (and it needs to be in reuseport group, so 
that packets could reach proper worker).

As I said, there still work to do in regard to reloads and upgrades.


More information about the nginx-devel mailing list