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

Replaced os.Exit with RemoteWeavelet Wait method. #531

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

mwhittaker
Copy link
Member

Recall that a RemoteWeavelet maintains (1) an RPC server to serve remote component method calls from other weavelets and (2) a connection to the envelope. Before this PR, a RemoteWeavelet would os.Exit if either (1) or (2) went down. This made testing failure scenarios impossible, as the process would simply exit.

This PR removes the calls to os.Exit. Instead, I added a Wait method to the RemoteWeavelet that blocks until the weavelet has shut down and returns any errors encountered during shutdown. With this new Wait method, I was able to add a unit test to test the behavior of a weavelet when its connection to the envelope breaks.

@mwhittaker mwhittaker requested a review from spetrovic77 August 15, 2023 21:57
@mwhittaker mwhittaker self-assigned this Aug 15, 2023
Copy link
Contributor

@spetrovic77 spetrovic77 left a comment

Choose a reason for hiding this comment

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

Nice, complex, change!

@mwhittaker mwhittaker force-pushed the update_components_fixes branch from d7326c4 to 856d81d Compare August 21, 2023 17:28
Base automatically changed from update_components_fixes to main August 21, 2023 17:34
Recall that a RemoteWeavelet maintains (1) an RPC server to serve remote
component method calls from other weavelets and (2) a connection to the
envelope. Before this PR, a RemoteWeavelet would os.Exit if either (1)
or (2) went down. This made testing failure scenarios impossible, as the
process would simply exit.

This PR removes the calls to os.Exit. Instead, I added a Wait method to
the RemoteWeavelet that blocks until the weavelet has shut down and
returns any errors encountered during shutdown. With this new Wait
method, I was able to add a unit test to test the behavior of a weavelet
when its connection to the envelope breaks.
@mwhittaker mwhittaker force-pushed the remote_weavelet_wait branch from b4280a7 to eb29108 Compare August 21, 2023 17:36
@mwhittaker mwhittaker merged commit e11bbb2 into main Aug 21, 2023
@mwhittaker mwhittaker deleted the remote_weavelet_wait branch August 21, 2023 17:42
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.

2 participants