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

Option --keep-sensors-on-exit doesn't work with disabling/enabling policies #3033

Closed
mtardy opened this issue Oct 23, 2024 · 0 comments · Fixed by #3079
Closed

Option --keep-sensors-on-exit doesn't work with disabling/enabling policies #3033

mtardy opened this issue Oct 23, 2024 · 0 comments · Fixed by #3079

Comments

@mtardy
Copy link
Member

mtardy commented Oct 23, 2024

I think I bumped into an unexpected thing while fixing the memory use of disabled policies.

If you use the --keep-sensors-on-exit, then when you use tetra tp disable <policy-name>, you trigger .Unload() on the program which is expecting mostly to be called on exit it seems since we don't unpin the progs if option.Config.KeepSensorsOnExit is here.

func (pu PinUnloader) Unload() error {
defer pu.Prog.Close()
if !option.Config.KeepSensorsOnExit {
return pu.Prog.Unpin()
}
return nil
}

Thus you didn't disable the policy, so --keep-sensors-on-exit doesn't work currently with the enable/disable feature.

cc @olsajiri

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 a pull request may close this issue.

1 participant