Raise netlink buffers for large batches; restore snapshot when try apply fails
This commit is contained in:
+3
-3
@@ -89,10 +89,10 @@ func tryApply(cfg *config.Config, fallback time.Duration) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
if err := engine.Apply(changes); err != nil {
|
||||
if derr := tryapply.Discard(); derr != nil {
|
||||
err = fmt.Errorf("%w (discarding snapshot: %v)", err, derr)
|
||||
if aerr := tryapply.Abort(); aerr != nil {
|
||||
return "", fmt.Errorf("applying changes: %w; %v; the revert timer restores the previous ruleset within %s", err, aerr, fallback)
|
||||
}
|
||||
return "", fmt.Errorf("applying changes: %w", err)
|
||||
return "", fmt.Errorf("applying changes: %w: previous ruleset restored", err)
|
||||
}
|
||||
return id, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user