-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
fix: lock-free counters for auth_zone up/down queries #1169
Conversation
Hi @sakateka, sorry for the delayed response. Removing the lock for authzones in #1160 is not a desired feature because the lock is needed during operation to handle zone updates with XFR for example. So I would like to close that PR if you don't mind :) I like the idea of moving the authzone counters out of locks but putting them in If you would like to rework the PR you could put the counters in |
Indeed, I missed it, thank you! |
0cfb0c7
to
29c77d8
Compare
Hi @gthess, it seems I didn't mess up anything and did everything right this time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Just a small change and this can be merged.
daemon/stats.c
Outdated
s->svr.num_query_authzone_up = (long long)worker->env.mesh->num_query_authzone_up; | ||
s->svr.num_query_authzone_down = (long long)worker->env.mesh->num_query_authzone_down; | ||
} else { | ||
s->svr.num_query_authzone_up = 0; | ||
s->svr.num_query_authzone_down = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily needed in this case but for consistency with other mesh->
values these should be added.
The else is not needed since the worker stats are initialized and reset based on configuration.
s->svr.num_query_authzone_up = (long long)worker->env.mesh->num_query_authzone_up; | |
s->svr.num_query_authzone_down = (long long)worker->env.mesh->num_query_authzone_down; | |
} else { | |
s->svr.num_query_authzone_up = 0; | |
s->svr.num_query_authzone_down = 0; | |
s->svr.num_query_authzone_up += (long long)worker->env.mesh->num_query_authzone_up; | |
s->svr.num_query_authzone_down += (long long)worker->env.mesh->num_query_authzone_down; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
29c77d8
to
2c72a49
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Now counting for auth_zone stats can happen lock free per thread and the values can be aggregated for the stat commands.
- Merge #1169 from Sergey Kacheev, fix: lock-free counters for auth_zone up/down queries.
* nlnet/master: (26 commits) - For NLnetLabs#1175, update serve-expired tests. - Fix NLnetLabs#1175: serve-expired does not adhere to secure-by-default principle. The default value of serve-expired-client-timeout is set to 1800 as suggested by RFC8767. - Fix comparison to help static analyzer. Changelog entry for NLnetLabs#1169: - Merge NLnetLabs#1169 from Sergey Kacheev, fix: lock-free counters for auth_zone up/down queries. fix: lock-free counters for auth_zone up/down queries - Fix for NLnetLabs#1183: release nsec3 hashes per test file. - Fix NLnetLabs#1183: the data being used is released in method nsec3_hash_test_entry. - Complete fix for max-global-quota to 200. - More descriptive text for 'harden-algo-downgrade'. - Increase the default of max-global-quota to 200 from 128 after operational feedback. Still keeping the possible amplification factor (CAMP related issues) in the hundreds. Changelog entry for: - Fix SETEX check during Redis (re)initialization. - Fix SETEX check during Redis (re)initialization. - Fix to log redis timeout error string on failure. - Fix for the serve expired DNSSEC information fix, it would not allow current delegation information be updated in cache. The fix allows current delegation and validation recursion information to be updated, but as a consequence no longer has certain expired information around for later dnssec valid expired responses. Changelog note for NLnetLabs#1167 - Merge NLnetLabs#1167: Makefile.in: fix occasional parallel build failures around bison rule. Makefile.in: fix occasional parallel build failures around bison rule (NLnetLabs#1167) - Fix redis that during a reload it does not fail if the redis server does not connect or does not respond. It still logs the errors and if the server is up checks expiration features. - Fix redis that during a reload it does not fail if the redis server does not connect or does not respond. It still logs the errors and if the server is up checks expiration features. Changelog entry for NLnetLabs#1157: - Merge NLnetLabs#1157 from Liang Zhu, Fix heap corruption when calling ub_ctx_delete in Windows. Fix heap corruption when calling ub_ctx_delete in Windows (NLnetLabs#1157) ...
It is simplified version of #1160