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

Cleanup adaptor #477

Merged
merged 4 commits into from
Nov 10, 2021
Merged

Cleanup adaptor #477

merged 4 commits into from
Nov 10, 2021

Conversation

mary-dcouto
Copy link
Contributor

close #476

This fix cleans up the tun adaptor if WDE fails during the initialisation of tun. I could not reproduce the issue where the tun will be in hung state. So I could not test the clean up of adaptor that is in hung state.

@@ -90,6 +90,7 @@ func SubMain(ops chan string, changes chan<- svc.Status, winEvents <-chan Window
// initialize the network interface
err := initialize(cLogLevel)
if err != nil {
rts.Close()
Copy link
Member

Choose a reason for hiding this comment

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

maybe it would make more sense to just defer rts.Close() ?

Copy link
Member

Choose a reason for hiding this comment

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

probably just before initialize is called. when this function exits - the service is shutting down. seems like it makes sense to defer it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@mary-dcouto mary-dcouto merged commit b9447b6 into release-next Nov 10, 2021
@mary-dcouto mary-dcouto deleted the cleanup-adaptor branch November 10, 2021 14:19
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.

WDE creates the tun adapter and fails, when the old one is in hung state
2 participants