Skip to content

fix: agent panics on closed network #5295

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

Merged
merged 5 commits into from
Dec 5, 2022
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Dec 5, 2022

Fixes: #5293

This PR adds a simple condition, network != nil, to prevent the agent from panicking.

@mtojek mtojek marked this pull request as ready for review December 5, 2022 18:57
@mtojek mtojek requested a review from a team December 5, 2022 18:58
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -266,7 +266,6 @@ func (a *agent) createTailnet(ctx context.Context, derpMap *tailcfg.DERPMap) (ne
network.Close()
}
}()
a.network = network
Copy link
Member

Choose a reason for hiding this comment

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

Let's be mindful about this one if we notice anything weird with the stats agent. Some stats message may be discarded until a.network is reassigned. But maybe this won't matter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I will keep an eye on this one.

@mtojek mtojek merged commit d320038 into coder:main Dec 5, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flaky: TestAgent tailnet.(*Conn).Close() panics
2 participants