Commit 98d68632 authored by Adam Rice's avatar Adam Rice Committed by Chromium LUCI CQ

Revert "Shutdown UDP sockets before close on Mac OS"

This reverts commit 0e75ebad.

Reason for revert: The workaround did not stop the crashes.

Original change's description:
> Shutdown UDP sockets before close on Mac OS
>
> On Big Sur, guarded_close_np() has started sometimes returning
> EPROTOTYPE or ENOTCONN errors. Try calling shutdown() before close as
> a speculative workaround.
>
> BUG=1151048
>
> Change-Id: I99e4a58f1468027402099fd5b0220872f14b1578
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561079
> Reviewed-by: David Schinazi <dschinazi@chromium.org>
> Commit-Queue: Adam Rice <ricea@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#833429}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1151048
Change-Id: Idea3fef1f32cc4c97a239e5e7e799ab5ed7eb520
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2592572Reviewed-by: default avatarDavid Schinazi <dschinazi@chromium.org>
Commit-Queue: David Schinazi <dschinazi@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Auto-Submit: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837190}
parent 7db62c0e
......@@ -292,11 +292,6 @@ void UDPSocketPosix::Close() {
// crbug.com/906005.
CHECK_EQ(socket_hash_, GetSocketFDHash(socket_));
#if defined(OS_MAC)
// This is a speculative workaround for https://crbug.com/1151048. The idea is
// that the call to shutdown() will absorb any errors on the socket, so they
// won't be reported by close.
// TODO(ricea): Remove if this if it doesn't work or a proper fix is found.
HANDLE_EINTR(shutdown(socket_, SHUT_RDWR));
PCHECK(IGNORE_EINTR(guarded_close_np(socket_, &kSocketFdGuard)) == 0);
#else
PCHECK(IGNORE_EINTR(close(socket_)) == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment