public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH-SERIES http-server 0/3] fix disconnecting clients
@ 2025-04-08 14:20 Fiona Ebner
  2025-04-08 14:20 ` [pve-devel] [PATCH http-server 1/3] anyevent: disconnect: check that handle is still defined before calling shutdown() Fiona Ebner
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-04-08 14:20 UTC (permalink / raw)
  To: pve-devel

Commit 07e56cc ("fix unexpected EOF for client when closing TLS
session") added a call to stoptls() before the call to shutdown() for
the handle's file descriptor. However, the documentation for
AnyEvent[0] mentions for stoptls():

> This method may invoke callbacks (and therefore the handle might be
> destroyed after it returns).

Indeed, the on_error callback might get invoked and lead to a
"detected empty handle" error message as reported in the community
forum [1].

Also, it is necessary to check that the handle is still defined
before calling shutdown(). Otherwise, this can result in a warning:

> Can't use an undefined value as a symbol reference at
> /usr/share/perl5/PVE/APIServer/AnyEvent.pm line 150.

as reported in the community forum [1] too.


Patches 1/3 and 2/3 are fixes for the reported issues. Patch 3/3 is
further future-proofing.


[0]: https://metacpan.org/pod/AnyEvent::Handle#$handle-%3Estoptls
[1]: https://forum.proxmox.com/threads/164744/


Fiona Ebner (3):
  anyevent: disconnect: check that handle is still defined before
    calling shutdown()
  anyevent: always avoid re-entering client_do_disconnect() in on_error
    callback
  anyevent: handle 'disconnected' flag in client_do_disconnect() itself

 src/PVE/APIServer/AnyEvent.pm | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-08 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-08 14:20 [pve-devel] [PATCH-SERIES http-server 0/3] fix disconnecting clients Fiona Ebner
2025-04-08 14:20 ` [pve-devel] [PATCH http-server 1/3] anyevent: disconnect: check that handle is still defined before calling shutdown() Fiona Ebner
2025-04-08 14:20 ` [pve-devel] [PATCH http-server 2/3] anyevent: always avoid re-entering client_do_disconnect() in on_error callback Fiona Ebner
2025-04-08 14:20 ` [pve-devel] [PATCH http-server 3/3] anyevent: handle 'disconnected' flag in client_do_disconnect() itself Fiona Ebner
2025-04-08 14:51 ` [pve-devel] [PATCH-SERIES http-server 0/3] fix disconnecting clients Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal