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

Restart ASIO if needed while runtime is attempting to terminate. #2373

Merged
merged 1 commit into from Nov 25, 2017

Conversation

Projects
None yet
2 participants
@dipinhora
Copy link
Contributor

commented Nov 25, 2017

Prior to this commit, the shutdown process could potentially cause
the runtime to end up in an invalid state where the ASIO backend
had been stopped but the shutdown of the runtime was aborted. If
this occurred and any actor subsequently tried to subscribe to
an ASIO event, it would cause a segfault because the ASIO backend
would be NULL instead of an actual asio_backend_t*.

This commit changes things so that if the shutdown is aborted due
to the receipt of a new UNBLOCK message and the ASIO backend
has already been stopped, we try and restart the ASIO backend.

This commit also adds some extra assertions around the use of the
ASIO backend to ensure it is not NULL when it shouldn't be.

This should resolve WallarooLabs/wallaroo#1608.

Restart ASIO if needed and add some assertions
Prior to this commit, the shutdown process could potentially cause
the runtime to end up in an invalid state where the ASIO backend
had been stopped but the shutdown of the runtime was aborted. If
this occurred and any actor subsequently tried to subscribe to
an ASIO event, it would cause a segfault because the ASIO backend
would be `NULL` instead of an actual `asio_backend_t*`.

This commit changes things so that if the shutdown is aborted due
to the receipt of a new `UNBLOCK` message and the ASIO backend
has already been stopped, we try and restart the ASIO backend.

This commit also adds some extra assertions around the use of the
ASIO backend to ensure it is not `NULL` when it shouldn't be.

This should resolve WallarooLabs/wallaroo/issues/1608.

@dipinhora dipinhora force-pushed the dipinhora:asio_assertions branch from 0cb9d68 to 6b21117 Nov 25, 2017

@jemc jemc changed the title Restart ASIO if needed and add some assertions Restart ASIO if needed while runtime is attempting to terminate. Nov 25, 2017

@jemc jemc merged commit c50bf31 into ponylang:master Nov 25, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

ponylang-main added a commit that referenced this pull request Nov 25, 2017

dipinhora added a commit to dipinhora/ponyc that referenced this pull request Nov 27, 2017

Fail pony_start if ASIO backend wasn't successfully initialized
Prior to this commit, the ASIO backend could fail initialization
but the runtime would continue to start up anyway resulting in
segfaults or assertion failures.

This commit changes things so that if the backend initialization
fails, the runtime exits immediately with an error.

This commit also fixes the asio restart logic from PR ponylang#2373 to
properly re-initialize the backend first.

dipinhora added a commit to dipinhora/ponyc that referenced this pull request Nov 27, 2017

Fail pony_start if ASIO backend wasn't successfully initialized
Prior to this commit, the ASIO backend could fail initialization
but the runtime would continue to start up anyway resulting in
segfaults or assertion failures.

This commit changes things so that if the backend initialization
fails, the runtime exits immediately with an error.

This commit also fixes the asio restart logic from PR ponylang#2373 to
properly re-initialize the backend first.

dipinhora added a commit to dipinhora/ponyc that referenced this pull request Nov 27, 2017

Fail pony_start if ASIO backend wasn't successfully initialized
Prior to this commit, the ASIO backend could fail initialization
but the runtime would continue to start up anyway resulting in
segfaults or assertion failures.

This commit changes things so that if the backend initialization
fails, the runtime exits immediately with an error.

This commit also fixes the asio restart logic from PR ponylang#2373 to
properly re-initialize the backend first.

SeanTAllen added a commit that referenced this pull request Nov 28, 2017

Fail pony_start if ASIO backend wasn't successfully initialized
Prior to this commit, the ASIO backend could fail initialization
but the runtime would continue to start up anyway resulting in
segfaults or assertion failures.

This commit changes things so that if the backend initialization
fails, the runtime exits immediately with an error.

This commit also fixes the asio restart logic from PR #2373 to
properly re-initialize the backend first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.