Skip to content
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

[5.0 -> main] don't run EOS VM OC's monitor compile task callback when socket being dtored #1830

Merged
merged 3 commits into from
Oct 26, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ struct compile_monitor_session {
void read_message_from_compile_task(std::list<std::tuple<code_tuple, local::datagram_protocol::socket>>::iterator current_compile_it) {
auto& [code, socket] = *current_compile_it;
socket.async_wait(local::datagram_protocol::socket::wait_read, [this, current_compile_it](auto ec) {
//at this point we only expect 1 of 2 things to happen: we either get a reply (success), or we get no reply (failure)
//at this point we generally expect 1 of 2 things to happen: we either get a reply (success), or we get an error reading from the
// socket (failure). But there is also a third possibility that this compile_monitor_session is being destroyed and thus the
// socket is being destroyed by way of current_compiles being destroyed. Since this is an async_wait() and not an async_read(),
// for now just consider any error as being due to cancellation at dtor time and completely bail out (there aren't many other
// potential errors for an asnyc_wait)
if(ec)
return;
auto& [code, socket] = *current_compile_it;
auto [success, message, fds] = read_message_with_fds(socket);

Expand Down