Skip to content

fix: client kill preempts in atomic section on shutdown #5283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kostasrim
Copy link
Contributor

The problem is that TlsSocket::Shutdown is preemptive because it flushes its buffer on the socket. However this violated the FiberAtomicGuard when traversing the connection list on each shard. To fix this, we move the shutdown call to another fiber.

@kostasrim kostasrim self-assigned this Jun 12, 2025
facade::Connection::WeakRef ref = std::move(kill_list.front());
kill_list.pop_front();
facade::Connection* conn = ref.Get();
// TODO think how to handle migration for eval. See RequestAsyncMigration
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to think what we can do here

@@ -535,14 +535,39 @@ void ClientKill(CmdArgList args, absl::Span<facade::Listener*> listeners, SinkRe

const bool is_admin_request = cntx->conn()->IsPrivileged();

std::vector<util::fb2::Fiber> fibers(pp->size() * listeners.size());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO we could also have a single fiber per shard which sleeps and wake up when we push work to its queue. IMO I have no preference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant