evdns caching
Revived from https://github.com/nmathewson/Libevent/pull/42 with an option to disable as requested.
Coverage decreased (-80.6%) to 0.0% when pulling 4a24f5c18167b1732a609ed3ae6e922a9a7e2860 on ghazel:evdns_caching into b49c70cc2ed54f511e2b41f7ed61d357c88300be on libevent:master.
Coverage decreased (-80.6%) to 0.0% when pulling 4a24f5c18167b1732a609ed3ae6e922a9a7e2860 on ghazel:evdns_caching into b49c70cc2ed54f511e2b41f7ed61d357c88300be on libevent:master.
Coverage increased (+0.04%) to 80.608% when pulling 8269e621b9d1e673b3a72dd7f243c67df6990699 on ghazel:evdns_caching into b49c70cc2ed54f511e2b41f7ed61d357c88300be on libevent:master.
Sounds cool, many kudos to you.
Not sure about turning the cache on by default (but I guess doesn't worries me a lot), did you do it in purpose? And could please add some tests for this new major functionality? In the meantime I need sometime to play with it.
Also it will be great to add this cache into server too (but this can be done in a separate patch of course)
And also was it intended that it works only via evutil_getaddrinfo_async_() or I missing something?
Hi @ghazel , any progress?
Rebased. Yes, I only applied caching to the async resolver implemented in libevent. The blocking OS resolver implementations often have caching of their own.
And yes, on by default. It improves performance, and doesn't violate the TTL of the records.
Coverage decreased (-80.5%) to 0.0% when pulling b3e5f3f89e8dea771b6b4371fde73113ff4b2b77 on ghazel:evdns_caching into 416b48ba7a0b44407b7a053bd21830aa75d7162f on libevent:master.
Coverage increased (+0.08%) to 80.601% when pulling 7c93e9d7e598107048b19105695b76e734d7117f on ghazel:evdns_caching into 416b48ba7a0b44407b7a053bd21830aa75d7162f on libevent:master.
Coverage increased (+0.08%) to 80.601% when pulling 7c93e9d7e598107048b19105695b76e734d7117f on ghazel:evdns_caching into 416b48ba7a0b44407b7a053bd21830aa75d7162f on libevent:master.
Rebased. Yes, I only applied caching to the async resolver implemented in libevent. The blocking OS resolver implementations often have caching of their own.
By "works only for evutil_getaddrinfo_async_()" I meant that it doesn't work for evdns_base_resolve_ipv4() (and others), or I missing something?