Re: [pve-devel] [RFC PATCH] fix #3106: correctly queue incoming connections

2020-11-03 Thread Dietmar Maurer
Answering myself, this works as expected. I now simply use Arc::new(()) to count references. > On 11/03/2020 6:45 PM Dietmar Maurer wrote: > > > > > +Ok((sock, _addr)) => { > > > +sock.set_nodelay(true).unwrap(); > > > +let _ = set_tcp_

Re: [pve-devel] [RFC PATCH] fix #3106: correctly queue incoming connections

2020-11-03 Thread Dietmar Maurer
> > +Ok((sock, _addr)) => { > > +sock.set_nodelay(true).unwrap(); > > +let _ = set_tcp_keepalive(sock.as_raw_fd(), > > PROXMOX_BACKUP_TCP_KEEPALIVE_TIME); > > +let acceptor = Arc::clone(&acceptor); > > +

Re: [pve-devel] [RFC PATCH] fix #3106: correctly queue incoming connections

2020-11-03 Thread Dietmar Maurer
> On Tue, Nov 03, 2020 at 02:25:21PM +0100, Dietmar Maurer wrote: > > > > -let connections = > > > > proxmox_backup::tools::async_io::HyperAccept(connections); > > > > +let connections = accept_connections(listener, acceptor); > > > > +let connections = > > > >

Re: [pve-devel] [RFC PATCH] fix #3106: correctly queue incoming connections

2020-11-03 Thread Wolfgang Bumiller
On Tue, Nov 03, 2020 at 02:25:21PM +0100, Dietmar Maurer wrote: > > > -let connections = > > > proxmox_backup::tools::async_io::HyperAccept(connections); > > > +let connections = accept_connections(listener, acceptor); > > > +let connections = > > > hyper::serv

Re: [pve-devel] [RFC PATCH] fix #3106: correctly queue incoming connections

2020-11-03 Thread Dietmar Maurer
> > -let connections = > > proxmox_backup::tools::async_io::HyperAccept(connections); > > +let connections = accept_connections(listener, acceptor); > > +let connections = > > hyper::server::accept::from_stream(connections); > > If we move the `from_stream` in

Re: [pve-devel] [RFC PATCH] fix #3106: correctly queue incoming connections

2020-11-03 Thread Wolfgang Bumiller
generally ACKed, but I have some notes: On Tue, Nov 03, 2020 at 01:26:36PM +0100, Dietmar Maurer wrote: > --- > > based, on Domink's patch, but with the following changes: > > - factor out code into separate function accept_connections() > - no select with shutdown future (no needed) > - rem

Re: [pve-devel] [RFC PATCH] fix #3106: correctly queue incoming connections

2020-11-03 Thread Dominik Csapak
looks better than mine :) comment inline On 11/3/20 1:26 PM, Dietmar Maurer wrote: --- based, on Domink's patch, but with the following changes: - factor out code into separate function accept_connections() - no select with shutdown future (no needed) - remove sender2.send_timeout() -

[pve-devel] [RFC PATCH] fix #3106: correctly queue incoming connections

2020-11-03 Thread Dietmar Maurer
--- based, on Domink's patch, but with the following changes: - factor out code into separate function accept_connections() - no select with shutdown future (no needed) - remove sender2.send_timeout() - not sure why this was there? - restict number of spawned tasks Seems to work, but I get