fix raciness in AsyncBase::submit
Summary: AsyncBase::submit() is racy: it calls submitOne() and then later calls op->start(). But op can be completed between return from submit and call to start(). In this case a CHECK will fail somewhere, either because we see op as COMPLETED in start(), or because we see op as INITALIZED in complete(). Call start() to put ops into PENDING state *before* issuing them; add "unstart" method to put them back into INITIALIZED state when submit fails. In passing, fix bug: if submit submits fewer ops than expected, decrement pending count properly. Differential Revision: D24094495 fbshipit-source-id: 2508dbd7ba5d306ceba34d62471d957f6cb20ff5
Showing
Please register or sign in to comment