From 22f70c4daf9f33c9ecdd3bcffa04f607834a7019 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Tue, 13 Jul 2021 16:10:34 +0000 Subject: [PATCH 1/2] Replace assert with warning in error event processing --- iocore/net/UnixNet.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc index ca803fff3c0..395b3b52c7c 100644 --- a/iocore/net/UnixNet.cc +++ b/iocore/net/UnixNet.cc @@ -523,8 +523,16 @@ NetHandler::waitForActivity(ink_hrtime timeout) write_ready_list.enqueue(ne); } } else if (!(flags & (EVENTIO_READ))) { - Debug("iocore_net_main", "Unhandled epoll event: 0x%04x", get_ev_events(pd, x)); - ink_release_assert(false); + Debug("iocore_net_main", "Unhandled epoll event: 0x%04x", flags); + // Temporarily replacing the asssert with a warning message and logic + // to treat this case on the write queue, so we can get some information + // about the flags that show up in the case. Unfortunately in the core that + // results from the assert, the flags variable is optimized out + Warning("Unhandled epoll event: 0x%x", flags); + ne->write.triggered = 1; + if (!write_ready_list.in(ne)) { + write_ready_list.enqueue(ne); + } } } else if (epd->type == EVENTIO_DNS_CONNECTION) { if (epd->data.dnscon != nullptr) { From e003040f7a35a2250d987eecf84342093cc78068 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Fri, 16 Jul 2021 18:22:59 +0000 Subject: [PATCH 2/2] Release warning with non-release assert for expected flag values --- iocore/net/UnixNet.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc index 395b3b52c7c..019bcaa8279 100644 --- a/iocore/net/UnixNet.cc +++ b/iocore/net/UnixNet.cc @@ -524,11 +524,9 @@ NetHandler::waitForActivity(ink_hrtime timeout) } } else if (!(flags & (EVENTIO_READ))) { Debug("iocore_net_main", "Unhandled epoll event: 0x%04x", flags); - // Temporarily replacing the asssert with a warning message and logic - // to treat this case on the write queue, so we can get some information - // about the flags that show up in the case. Unfortunately in the core that - // results from the assert, the flags variable is optimized out - Warning("Unhandled epoll event: 0x%x", flags); + // In practice we sometimes see EPOLLERR and EPOLLHUP through there + // Anything else would be surprising + ink_assert((flags & ~(EVENTIO_ERROR)) == 0); ne->write.triggered = 1; if (!write_ready_list.in(ne)) { write_ready_list.enqueue(ne);