use context manager when recovering partial registration

Issue DE106