Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/iocore/net/UnixNetAccept.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ net_accept(NetAccept *na, void *ep, bool blockable)
if (res == -EAGAIN || res == -ECONNABORTED || res == -EPIPE) {
goto Ldone;
}
if (na->server.sock.is_ok() && !na->action_->cancelled) {
if (na->action_->server.load(std::memory_order_acquire) != nullptr && !na->action_->cancelled) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes some assumptions about invariants for action cancellation. Copilot's justification for its proposed solution is more than insufficient given the risk.

if (!blockable) {
na->action_->continuation->handleEvent(EVENT_ERROR, reinterpret_cast<void *>(res));
} else {
Expand Down Expand Up @@ -387,7 +387,7 @@ NetAccept::do_blocking_accept(EThread *t)
case -1:
[[fallthrough]];
default:
if (!action_->cancelled) {
if (action_->server.load(std::memory_order_acquire) != nullptr && !action_->cancelled) {
SCOPED_MUTEX_LOCK(lock, action_->mutex ? action_->mutex : t->mutex, t);
action_->continuation->handleEvent(EVENT_ERROR, reinterpret_cast<void *>(res));
Warning("accept thread received fatal error: errno = %d", errno);
Expand Down Expand Up @@ -580,7 +580,7 @@ NetAccept::acceptFastEvent(int event, void *ep)
check_transient_accept_error(res);
goto Ldone;
}
if (!action_->cancelled) {
if (action_->server.load(std::memory_order_acquire) != nullptr && !action_->cancelled) {
action_->continuation->handleEvent(EVENT_ERROR, reinterpret_cast<void *>(res));
}
goto Lerror;
Expand Down