[mcrouter] Better reporting of bad keys

Summary: provide the reason why the key is invalid.

Test Plan: unit tests

Reviewed By: bwatling@fb.com

Subscribers: trunkagent, alikhtarov

FB internal diff: D1723379
Add an option to attach default routing prefix to a key

Summary:
sometimes it is useful to attach default routing prefix even when the key doesn't have one.

Test Plan: unit test attached

Reviewed By: alikhtarov@fb.com

Subscribers: trunkagent, alikhtarov

FB internal diff: D1728222
Kill fb_timer_* usage

Summary:
Those timers doesn't measure anything (except timers themself).
The code between those calls is just a couple of instructions.

Test Plan: tests

Reviewed By: pavlo@fb.com

Subscribers: alikhtarov

FB internal diff: D1730365
AsyncMcClient with fibers

Summary:
We're currently awaiting in DestinationRoute/using callbacks for reply forwarding.
This diff moves that await into AsyncMcClient itself, which allows us to use it for storring some objects on stack instead of heap.

Since I was touching some of send() functions, I templated them by Operation and Result. But there's still a lot to do to get everything templated.

Test Plan: tests

Reviewed By: alikhtarov@fb.com

Subscribers: trunkagent, alikhtarov

FB internal diff: D1732966
Don't enter in background mode if we are just validating configs.

Summary:
We don't need to (and should not) enter in background mode if we are
just validating configs.

Test Plan: Unit tests and ran -b with and without --validate-config

Reviewed By: pavlo@fb.com

Subscribers: trunkagent, alikhtarov

FB internal diff: D1736900
Fix ShutdownLock logic

Summary:
This fixes a potential deadlock if we try to obtain a ShutdownLock while
another thread already initiated the shutdown.
The new logic is:
1. Atomically set shutdownStarted_ to true (this prevents new readers from obtaining the lock)
2. Wait for all readers to drain (via obtaining a write lock)
3. Run func()

Test Plan: unit tests

Reviewed By: andrii@fb.com

Subscribers: alikhtarov

FB internal diff: D1740713

Tasks: 5819935
codemod: folly/wangle/ -> folly/wangle/futures

Summary: Last thing before moving experimental/wangle here. Once everything is in the same directory I'm probably going to consolidate experimental/wangle/concurrent with the executors in this directory into wangle/executors/. And probably rename some of these targets. For now, a dumb move is enough.

Test Plan: build it

Reviewed By: davejwatson@fb.com

FB internal diff: D1740327

Tasks: 5802833
Remove RouterLogger

Summary: it is not used.

Test Plan: mcrouter unit tests

Reviewed By: andrii@fb.com

FB internal diff: D1743154
Report type of HashRoute::HashFunc in __mcrouter__.route_handles

Summary: sometimes useful to know what HashFunc we use (e.g. WeightedCh3 vs Ch3)

Test Plan: run mcrouter and see "hash:Ch3" line.

Reviewed By: alikhtarov@fb.com

FB internal diff: D1741782
Cleanup options

Summary:
removed some deprecated options and features (track_open_fd).

Test Plan: mcrouter unit tests

Reviewed By: alikhtarov@fb.com

FB internal diff: D1739295

Tasks: 5825810
Add mcrouter_client_is_zombie

Summary: as per title.

Test Plan: unit test

Reviewed By: alikhtarov@fb.com

FB internal diff: D1746494
Do not start logging thread on stats_logging_interval == 0

Summary: we don't respect this option and actually end up in an infinite loop :-(

Test Plan: mcrouter unit tests

Reviewed By: aap@fb.com

Subscribers: alikhtarov

FB internal diff: D1749566

Tasks: 5528304
Use folly::AsyncTransportWrapper

Summary:
Fixup various test classes that depend on the interface.

Test Plan: unit tests

Reviewed By: hans@fb.com

FB internal diff: D1696094
Change PrefixPolicyRoute to OperationSelectorRoute

Summary:
Change PrefixPolicyRoute to OperationSelectorRoute but keep support for
old naming on configs.

Test Plan: Unit tests

Reviewed By: pavlo@fb.com, alikhtarov@fb.com

FB internal diff: D1749667

Tasks: 5680471
Fix test_rates

Test Plan: run test 100 times in a row

Reviewed By: alikhtarov@fb.com

Subscribers: alikhtarov

FB internal diff: D1752383

Tasks: 5853316
Fixes for libmcrouter_test

Summary: we need to make sure mock_mc_server didn't process request before calling mcrouter_client_disconnect.

Test Plan: run test 100 times in a row

Reviewed By: alikhtarov@fb.com

Subscribers: alikhtarov

FB internal diff: D1752390

Tasks: 5853316
Remove per-client devnull_asynclog

Test Plan: mcrouter unit tests

Reviewed By: alikhtarov@fb.com

Subscribers: trunkagent, alikhtarov

FB internal diff: D1746350
Remove priorities from ProxyClientCommon

Test Plan: mcrouter unit tests

Reviewed By: alikhtarov@fb.com

Subscribers: alikhtarov

FB internal diff: D1746366
Remove genProxyClientKey, cleanup ProxyClientCommon

Summary: genProxyClientKey generates unique key for each ProxyClientCommon. But we can get this key from pair (pool name, index in pool), so no reason to have hacky logic here.

Test Plan: mcrouter unit tests

Reviewed By: alikhtarov@fb.com

Subscribers: alikhtarov

FB internal diff: D1746377
Remove latency TKO

Summary: also fix test_tko and test_soft_tko_limits.

Test Plan: run tests 100 times in a row

Reviewed By: alikhtarov@fb.com

Subscribers: alikhtarov

FB internal diff: D1752396

Tasks: 5853316