Skip to content

Commit

Permalink
fix: channel is blocked when error equals nil
Browse files Browse the repository at this point in the history
Signed-off-by: ComixHe <[email protected]>
  • Loading branch information
ComixHe committed Oct 26, 2023
1 parent 19010ed commit 944d061
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
8 changes: 4 additions & 4 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ The "file exists" is error message of EEXIST, which means that:
2. Now you can just simply remove the route table and nftable ruleset by:

```bash
sudo ip route del table 300 local default dev lo scope host
sudo ip -6 route del table 300 local default dev lo scope host
sudo ip rule del fwmark 3000 lookup 300
sudo ip -6 rule del fwmark 3000 lookup 300
sudo ip route del table 400 local default dev lo scope host
sudo ip -6 route del table 400 local default dev lo scope host
sudo ip rule del fwmark 3000 lookup 400
sudo ip -6 rule del fwmark 3000 lookup 400
sudo nft flush table inet cgtproxy
sudo nft delete table inet cgtproxy
```
5 changes: 1 addition & 4 deletions pkg/nftman/private.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,7 @@ func getNFTableRules() string {
}

func (nft *NFTManager) genSetElement(route *types.Route) (ret nftables.SetElement, err error) {
defer Wrap(&err, "generating set element for route",
"Path", route.Path,
"Target", route.Target,
)
defer Wrap(&err, "generating set element for route %v", route)

nft.log.Debugw("Generating set element for new cgroup route.",
"Path", route.Path,
Expand Down
3 changes: 0 additions & 3 deletions pkg/routeman/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ func (m *RouteManager) RunRouteManager(ctx context.Context) (err error) {
newErr := m.handleNewCgroups(newCGroups)
delErr := m.handleDeleteCgroups(deleteCGroups)
eventsErr := errors.Join(newErr, delErr)
if eventsErr == nil {
continue
}

if events.Result != nil {
events.Result <- eventsErr
Expand Down

0 comments on commit 944d061

Please sign in to comment.