Page MenuHomePhabricator

Possibly fix issue with subpriority recursion

Authored by epriestley on Apr 22 2015, 11:13 PM.



Ref T7664. Currently, when spreading subpriorities we may recurse deeply in certain conditions. Make sure we never recurse more than one level.

To try to mitigate issues with floating point precision, be more aggressive about selecting tasks to reorder.

I wasn't really able to come up with a realistic test case here, and the test cases I found which sort of approximated the behavior took way too long to generate data to actually commit.

This approach is inherently somewhat fragile but hopefully this is approximately good enough. We don't have a durable storage engine which can meaningfully represent double-linked lists right now.

Test Plan
  • Wrote some (slow) tests which kind of approximately hit the issue.
  • Verified they maxed out at stack depth 2 after the change.
  • Unit tests still pass.
  • Dragged some tasks around.
  • Couldn't come up with any pathological issues here by thinking about it?

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.