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

[3.2 -> main] Backport SHiP fixes from eosio/eos release/2.2.x #638

Merged
merged 9 commits into from
Jan 13, 2023

Conversation

heifner
Copy link
Member

@heifner heifner commented Jan 13, 2023

Backport of state_history_plugin fixes: EOSIO/eos#10608

From the backport:

  • Create an additional thread for all ship network communication. This thread already existed in release/3.2 but was not used. See state_history_plugin unused code #593.
  • Fix bug where state history plugin would send blocks with block_num smaller than the client requests when the state history block head is behind the block head of the client.

Additional changes:

  • Remove session_manager_t and use post to main thread so session_set is only accessed from main thread.
  • Use named_thread_pool to simplify SHiP thread. Older versions of boost do not provide an acceptor that takes a strand in constructor, so rely on implicit strand of single thread running io_context which is much simpler than wrapping all calls in boost::asio::bind_executor.
  • Made sure the destructor of boost beast web socket stream is called on the SHiP thread. The session tests in Merge SHiP stability fixes & log splitting & memory usage improvements #628 would consistently crash in the the stream destructor when destroyed on the wrong thread.

Reproduced the crash of #592. After this PR, was unable to reproduce #592 crash.

This PR does not include accept too_many_files_open fix: #603
#577 has some of these changes already but takes a slightly different approach. I've updated #577 with the thread separation changes of this PR, see #628.

Resolves #592
Merges #624 (release/3.2) into main. These changes have also been applied in #628 along with other cleanups.

@heifner heifner merged commit 1626490 into main Jan 13, 2023
@heifner heifner deleted the GH-592-ship-crash-main branch January 13, 2023 19:59
@heifner heifner added the OCI Work exclusive to OCI team label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.2 state_history_plugin crashes under heavy load
3 participants