highfidelity/hifi — pull request #2135 by ZappoMan (2014-02-28 00:16:08+00:00)
Title: fix octree-server random spinout sometimes when client disconnects

this fixes #2039

What was happening is that if the NodeList saw our agent go away but we had it locked then it doesn't delete the node data, and we come back around and lock the node again, and so the node doesn't get deleted. But since the node no longer exists in the domain list we wouldn't find it by ID and we'd spin out.

The fix is to abandon our thread if we haven't been able to find our node by ID after a certain number of attempts.