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. |
gthess
left a comment
There was a problem hiding this comment.
Looking good!
Just a small change and this can be merged.
| 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.
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; |
29c77d8 to
2c72a49
Compare
gthess
left a comment
There was a problem hiding this comment.
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