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

fix: Fixing proxy_restart #3414

Merged
merged 2 commits into from
Sep 29, 2020
Merged

fix: Fixing proxy_restart #3414

merged 2 commits into from
Sep 29, 2020

Conversation

SkidanovAlex
Copy link
Collaborator

start_proxy starts a process that proxifies the node in the
background, and immediatelly returns control to the main process.
If the main process then kills the node, it sets local_stopped to 1.
If start_proxy hasn't gotten to check_finish yet, check_finish
will observe local_stopped set to 1, and stop the server.
start_proxy will then proceed to calling server.serve_forever, which
will crash.
I'm fixing it by making start_proxy actually wait until it gets to
serve_forever before returning control

@gitpod-io
Copy link

gitpod-io bot commented Sep 29, 2020

Copy link
Member

@mfornet mfornet left a comment

Choose a reason for hiding this comment

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

Nice catch!

`start_proxy` starts a process that proxifies the node in the
background, and immediatelly returns control to the main process.
If the main process then kills the node, it sets `local_stopped` to 1.
If `start_proxy` hasn't gotten to `check_finish` yet, `check_finish`
will observe `local_stopped` set to 1, and stop the server.
`start_proxy` will then proceed to calling `server.serve_forever`, which
will crash.
I'm fixing it by making `start_proxy` actually wait until it gets to
`serve_forever` before returning control
@nearprotocol-bulldozer nearprotocol-bulldozer bot merged commit 6efb708 into master Sep 29, 2020
@nearprotocol-bulldozer nearprotocol-bulldozer bot deleted the fix_proxy_restart branch September 29, 2020 22:30
chefsale pushed a commit that referenced this pull request Oct 5, 2020
`start_proxy` starts a process that proxifies the node in the
background, and immediatelly returns control to the main process.
If the main process then kills the node, it sets `local_stopped` to 1.
If `start_proxy` hasn't gotten to `check_finish` yet, `check_finish`
will observe `local_stopped` set to 1, and stop the server.
`start_proxy` will then proceed to calling `server.serve_forever`, which
will crash.
I'm fixing it by making `start_proxy` actually wait until it gets to
`serve_forever` before returning control
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants