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] don't run EOS VM OC's monitor compile task callback when socket being dtored #1827

Merged
merged 1 commit 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;
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to log this for potential debugging or just too much noises?

Copy link
Member

Choose a reason for hiding this comment

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

No higher than debug if you do log it; don't think we need it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Logging config won't be active in the monitor process since it's forked off before main() -- so debug won't be visible, and any error/warn/info messages won't honor the user's logging config either. So probably best to not log anything here.

auto& [code, socket] = *current_compile_it;
auto [success, message, fds] = read_message_with_fds(socket);

Expand Down