Did you actually encounter that Exception while using this code? The reason I ask is that line 307 should fail with NotEmptyException for any case where there is still a child. I guess the race you are mentioning is if two or more module instances happened to complete line 306 so that there are no children at all but then both try to proceed to line 307? (if so, we should explicitly ignore NoNodeException there as well... in general since we are *deleting* a NoNodeException should be harmless since it means "nothing to delete").