-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
About updating audit events when function gains new arguments #87922
Comments
I'm not sure what to do when a function already being audited gains new arguments which are also worth auditing. For example, bpo-38144 brings new
I guess more audited functions may gain new arguments in the future so this problem is unavoidable. I would like some suggestions from Steve. Thanks! |
Solution 1 is definitely out, as PyArg_ParseTuple is a very valid way to implement hooks but won't handle longer tuples. For Solution 2, we already have some events that use a slash to indicate "extra" information, so depending on context I'd either do "glob.glob/2" or add both "glob.glob/root_dir" and "glob.glob/dir_fd" events. I suspect in this case, the "glob.glob/2" name is better, because all the data really has to come together. Sending those values through separately might make more sense if there's some other linkable id (such as for socket events). Nobody should handle hooks that they don't expect with anything other than *args (and even then they should be careful, as hooks may pass through MB or GB of data, so logging or printing them directly may be a bad idea). |
And one more question, should we ever remove an old version of event when we add a new version of it? A function whose signature got repeatedly changed may result in several versions of audit event raised together on a single operation, which is probably not good for performance. But removing the old event will make those hooks which are not written to handle the new version of the event unable to receive the old event at all, which doesn't look good. |
To remove an event, it needs to be deprecated as any public facing feature would be deprecated. I'm not sure how we'd go about publicising it though. There's currently no way to raise a warning, so it'd just have to be very clearly advertised in documentation (as a breaking change). Easiest to assume that an event will be permanent. If there's a significant impact due to an event that we want to avoid, we can address it then. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: