PowerDNS / weakforced

Anti-Abuse for servers at authentication time
GNU General Public License v3.0
123 stars 33 forks source link

Refactor lustate handling to be much more efficient #419

Closed neilcook closed 4 months ago

neilcook commented 5 months ago

Previously luastates were stored in an array. Worker threads accessed luastates by simply retrieving the "next" state in the array, regardless of whether that state was in use or not. This commit instead uses a pool approach, where worker threads pop the state off the aray while the state is in use, then return the state once it's no longer needed (automatically via destructor). A read-only copy of the entire array is maintained for the console/ control thread which needs to be able to call all luastates.

github-actions[bot] commented 5 months ago

Test Results

  2 files  ±0    2 suites  ±0   32m 9s :stopwatch: ±0s  70 tests ±0   70 :white_check_mark: ±0  0 :zzz: ±0  0 :x: ±0  140 runs  ±0  140 :white_check_mark: ±0  0 :zzz: ±0  0 :x: ±0 

Results for commit b2b11467. ± Comparison against base commit acbdfd97.