all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
	"Fabian Grünbichler" <f.gruenbichler@proxmox.com>
Subject: [pve-devel] applied: [PATCH http-server] fix #4816: do not disconnect twice if client sends no data
Date: Tue, 28 Jan 2025 15:30:22 +0100	[thread overview]
Message-ID: <22cc22d8-7d63-4b6b-820e-ee3846cd297e@proxmox.com> (raw)
In-Reply-To: <20241204095234.291884-1-f.gruenbichler@proxmox.com>

Am 04.12.24 um 10:52 schrieb Fabian Grünbichler:
> client_do_disconnect expects to be called exactly once per connection, since it
> takes care of closing and unsetting the handle corresponding to the connection.
> to find bugs in our connection handling, it will log "detected empty handle" if
> it is called for a request/connection that no longer has a handle.
> 
> the edge case of opening a connection without sending any data leads to the
> error callback being called twice:
> 
> Dec 04 09:37:02 xxx pveproxy[175235]: err (): Connection timed out
> 
> this is the (5 second) timeout triggering
> 
> Dec 04 09:37:02 xxx pveproxy[175235]: err (1): Broken pipe
> 
> this is AnyEvent trying to drain the buffer while the connection is already
> closed
> 
> as soon as a single byte of traffic is sent, only the timeout will trigger.
> 
> there is no guarantee that the on_error callback is only called once (in fact,
> it's possible to return from it for non-fatal errors and continue processing
> the connection).
> 
> if there are further reports of empty handles with this in place, other
> on_error callbacks might need similar logic - but it should only be added if
> the triggering conditions are clear and deemed safe. the additional logging is
> only cosmetic after all, but might point out an actual issue in our connection
> handling code.
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
>  src/PVE/APIServer/AnyEvent.pm | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
>

applied, thanks!


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

      reply	other threads:[~2025-01-28 14:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04  9:52 [pve-devel] " Fabian Grünbichler
2025-01-28 14:30 ` Thomas Lamprecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22cc22d8-7d63-4b6b-820e-ee3846cd297e@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal