Resolves #203 -- many thanks to @manimaul for the report!
Context
~6% of all requests are currently failing to resolve due to a concurrency NPE in ServerRateLimiter's RendezvousHash. The NPE occurs whenever multiple methods reset and populate a RendezvousHash's internal hashmap at the same.
This MR resolves the issue by no longer using a shared map and instead creating new instances on each call. Also includes some small refactors for clarity and a new testcase to help prevent regressions. The new test fails consistently with the original RendezvousHash code.
You can see from the performance regression script that current master fails with socket errors in 1912 / 32720 requests while this branch fails 0 / 76753.
Resolves #203 -- many thanks to @manimaul for the report!
Context
~6% of all requests are currently failing to resolve due to a concurrency NPE in
ServerRateLimiter
'sRendezvousHash
. The NPE occurs whenever multiple methods reset and populate aRendezvousHash
's internal hashmap at the same.This MR resolves the issue by no longer using a shared map and instead creating new instances on each call. Also includes some small refactors for clarity and a new testcase to help prevent regressions. The new test fails consistently with the original
RendezvousHash
code.You can see from the performance regression script that current master fails with socket errors in 1912 / 32720 requests while this branch fails 0 / 76753.
Regression on master:
Regression with branch: