<p dir="auto">Currently if a compute node receives a duplicate request it just does the same query twice. Should be pretty easy to keep track of in progress queries and if a dup comes in block the request until the results are cached (pretty much all read through caches do this)</p>
<p dir="auto">CachingCostBalancerStrategyFactory registers callbacks in its <code class="notranslate">start()</code> method, which is problematic since any callbacks that happen between start of ServerInventoryView and BalancerStrategyFactory will be missed. Inventory view callbacks should generally be registered in constructors, not in start methods.</p>
<p dir="auto">I discovered this when trying to test the cachingCost balancer on a cluster that has a small number of segments, and found that it missed the initialization callback (happened too fast) so it refused to create itself.</p>
<p dir="auto">cc: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dgolitsyn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dgolitsyn">@dgolitsyn</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/leventov/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/leventov">@leventov</a></p>