File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -636,7 +636,18 @@ actor TCPConnection is AsioEventNotify
636636 @pony_asio_event_unsubscribe (event)
637637 end
638638 @pony_os_socket_close (fd)
639- _try_shutdown ()
639+ ifdef windows then
640+ // Fix for windows happy-eyeballs related hang from
641+ // 95a06bb290150d13b5764de70c1332a6d7b237cf.
642+ // This should not be called on non-IOCP as that can result in
643+ // issue #4639 where we call `pony_asio_event_unsubscribe` more than
644+ // once which can result in an actor that is already marked
645+ // for destruction getting a message sent to it.
646+ // This might be a race condition on Windows (I think it could be)
647+ // but Windows is so slow closing down connections that we don't
648+ // to ever hit it if it is indeed a race condition.
649+ _try_shutdown ()
650+ endif
640651 end
641652 else
642653 // It's not our event.
You can’t perform that action at this time.
0 commit comments