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

Raise warnings when for DNS events that are not raised due to p_all_addl #4155

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

0xxon
Copy link
Member

@0xxon 0xxon commented Jan 7, 2025

By default, dns_skip_all_addl is set to false. This causes several events to not be raised. This change emits warnings when a user defines event handlers for events that will not be raised.

Furthermore, it adds notes about this behavior to the documentation. We also introduce a new BIF, is_event_handled, which checks if an event is handled.

Fixes GH-4061

…p_all_addl

By default, dns_skip_all_addl is set to false. This causes several
events to not be raised. This change emits warnings when a user defines
event handlers for events that will not be raised.

Furthermore, it adds notes about this behavior to the documentation. We
also introduce a new BIF, `is_event_handled`, which checks if an event
is handled.

Fixes GH-4061
@0xxon 0xxon mentioned this pull request Jan 7, 2025
0xxon added 2 commits January 8, 2025 15:01
This commit addresses review feedback for DH-4155. Furthermore it fixes
test failures, and adds a new test for the is_event_handled bif.
Copy link
Contributor

@awelzel awelzel left a comment

Choose a reason for hiding this comment

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

Approving. There's one more test failure about ZAM BiF tracking.

Some background how to fix is here: #4105

@vpax - could we treat unknown BiFs as having side-effects by default and keep some maintenance list outside of the btest infrastructure?

I'm also wondering if annotating functions with &pure or &no_side_effect or &idempotent instead would be a bit easier. Not just for us, also for new contributors. In the future, BiFs added by external plugins could also inform ZAM about their attributes/properties this way.

@vpax
Copy link
Contributor

vpax commented Jan 8, 2025

could we treat unknown BiFs as having side-effects by default and keep some maintenance list outside of the btest infrastructure?

I think that's indeed how they'll be treated. The BTest failure will occur but not the mis-use.

Regarding &pure etc. yeah I'd like that! A lot better than the maintainer having eyeball it. If we go down this path, at least some of the properties are documented in FuncInfo.h (I think that's the right place, haven't double-checked). There wound up being more than I had initially expected, such as idempotent-but-don't-call-until-Zeek-has-initialized.

keep some maintenance list outside of the btest infrastructure

Likewise sounds fine as long as it's pretty streamlined to figure out when to update it. (That might wind up being equivalent to the current BTest approach, but if you have thoughts for how to do it more readily, great!)

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 this pull request may close these issues.

EDNS Functionality
3 participants