Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

agent: fix #229: ensure deferred funcs run + cleanup#300

Merged
Joseph-Irving merged 2 commits intouswitch:masterfrom
charlievieth:cev/fix-agent-run
May 18, 2020
Merged

agent: fix #229: ensure deferred funcs run + cleanup#300
Joseph-Irving merged 2 commits intouswitch:masterfrom
charlievieth:cev/fix-agent-run

Conversation

@charlievieth
Copy link
Copy Markdown
Contributor

@charlievieth charlievieth commented Sep 27, 2019

This fixes #229 while also cleaning up the run logic to catch the error returned by server.Serve() and log when iptables changes are being undone.

This also changes the agent to handle server shutdown directly in the run() command and log any errors. Previously, the code relied on a deferred call to Stop() and errors were ignored.

This fixes uswitch#229 while also cleaning up the run logic to catch the error
returned by server.Serve() and log when iptables changes are being
undone.
Handle server shutdown directly in the run() command and log any errors.
Previously, the code relied on a deferred call to close to stop the
server and errors were ignored.
Copy link
Copy Markdown
Contributor

@Joseph-Irving Joseph-Irving left a comment

Choose a reason for hiding this comment

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

lgtm

@Joseph-Irving Joseph-Irving merged commit f041ea2 into uswitch:master May 18, 2020
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.

agent: iptables modifications are not cleaned up if log.Fatal() is called

2 participants