Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into GH-592-ship-crash-spl…
Browse files Browse the repository at this point in the history
…it-ship-log
  • Loading branch information
heifner committed Jan 16, 2023
2 parents baac068 + 1626490 commit ba0f168
Show file tree
Hide file tree
Showing 28 changed files with 202 additions and 770 deletions.
1 change: 0 additions & 1 deletion docs/01_nodeos/03_plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ For information on specific plugins, just select from the list below:
* [`test_control_api_plugin`](test_control_api_plugin/index.md)
* [`test_control_plugin`](test_control_plugin/index.md)
* [`trace_api_plugin`](trace_api_plugin/index.md)
* [`txn_test_gen_plugin`](txn_test_gen_plugin/index.md)

[[info | Nodeos is modular]]
| Plugins add incremental functionality to `nodeos`. Unlike runtime plugins, `nodeos` plugins are built at compile-time.
46 changes: 0 additions & 46 deletions docs/01_nodeos/03_plugins/txn_test_gen_plugin/index.md

This file was deleted.

1 change: 0 additions & 1 deletion plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ add_subdirectory(resource_monitor_plugin)
add_subdirectory(signature_provider_plugin)
add_subdirectory(wallet_plugin)
add_subdirectory(wallet_api_plugin)
add_subdirectory(txn_test_gen_plugin)
add_subdirectory(db_size_api_plugin)
add_subdirectory(test_control_plugin)
add_subdirectory(test_control_api_plugin)
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class beast_http_listener : public std::enable_shared_from_this<beast_http_liste
typename protocol_type::acceptor acceptor_;
socket_type socket_;

boost::asio::deadline_timer accept_error_timer_;

public:
beast_http_listener() = default;
beast_http_listener(const beast_http_listener&) = delete;
Expand All @@ -36,7 +38,7 @@ class beast_http_listener : public std::enable_shared_from_this<beast_http_liste
beast_http_listener& operator=(const beast_http_listener&) = delete;
beast_http_listener& operator=(beast_http_listener&&) = delete;

beast_http_listener(std::shared_ptr<http_plugin_state> plugin_state) : is_listening_(false), plugin_state_(std::move(plugin_state)), acceptor_(plugin_state_->thread_pool->get_executor()), socket_(plugin_state_->thread_pool->get_executor()) {}
beast_http_listener(std::shared_ptr<http_plugin_state> plugin_state) : is_listening_(false), plugin_state_(std::move(plugin_state)), acceptor_(plugin_state_->thread_pool->get_executor()), socket_(plugin_state_->thread_pool->get_executor()), accept_error_timer_(plugin_state_->thread_pool->get_executor()) {}

virtual ~beast_http_listener() {
try {
Expand Down Expand Up @@ -106,19 +108,29 @@ class beast_http_listener : public std::enable_shared_from_this<beast_http_liste
void do_accept() {
auto self = this->shared_from_this();
acceptor_.async_accept(socket_, [self](beast::error_code ec) {
if(ec) {
fail(ec, "accept", self->plugin_state_->logger, "closing connection");
if(ec == boost::system::errc::too_many_files_open) {
// retry accept() after timeout to avoid cpu loop on accept
fail(ec, "accept", self->plugin_state_->logger, "too many files open - waiting 500ms");
self->accept_error_timer_.expires_from_now(boost::posix_time::milliseconds(500));
self->accept_error_timer_.async_wait([self = self->shared_from_this()](beast::error_code ec) {
if (!ec)
self->do_accept();
});
} else {
// Create the session object and run it
std::make_shared<session_type>(
if (ec) {
fail(ec, "accept", self->plugin_state_->logger, "closing connection");
} else {
// Create the session object and run it
std::make_shared<session_type>(
std::move(self->socket_),
self->plugin_state_)
->run_session();
}

// Accept another connection
self->do_accept();
}

// Accept another connection
self->do_accept();
});
}
};// end class beast_http_Listener
}// namespace eosio
}// namespace eosio
10 changes: 5 additions & 5 deletions plugins/state_history_plugin/state_history_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ struct state_history_plugin_impl : std::enable_shared_from_this<state_history_pl
};

// create and configure acceptors, can be both
if (endpoint_address.size()) init_tcp_acceptor();
if (unix_path.size()) init_unix_acceptor();
if (!endpoint_address.empty()) init_tcp_acceptor();
if (!unix_path.empty()) init_unix_acceptor();

// start it
std::for_each(acceptors.begin(), acceptors.end(), [&](const acceptor_type& acc) {
Expand Down Expand Up @@ -227,15 +227,15 @@ struct state_history_plugin_impl : std::enable_shared_from_this<state_history_pl
return;
if (ec) {
if (ec == boost::system::errc::too_many_files_open)
catch_and_log([&] { do_accept(acceptor); });
catch_and_log([&] { self->do_accept(acceptor); });
return;
}
catch_and_log([&] {
auto s = std::make_shared<session<std::shared_ptr<state_history_plugin_impl>, typename Acceptor::protocol_type::socket>>(self, std::move(*socket));
s->start();
post_task_main_thread_high([self, s]() mutable { self->session_set.insert(std::move(s)); });
});
catch_and_log([&] { do_accept(acceptor); });
catch_and_log([&] { self->do_accept(acceptor); });
});
}

Expand Down Expand Up @@ -291,7 +291,7 @@ struct state_history_plugin_impl : std::enable_shared_from_this<state_history_pl
});
}

// calle from main thread
// called from main thread
void store_chain_state(const block_state_ptr& block_state) {
if (!chain_state_log)
return;
Expand Down
9 changes: 0 additions & 9 deletions plugins/txn_test_gen_plugin/CMakeLists.txt

This file was deleted.

89 changes: 0 additions & 89 deletions plugins/txn_test_gen_plugin/README.md

This file was deleted.

This file was deleted.

Loading

0 comments on commit ba0f168

Please sign in to comment.