Currently in Worker.send_task_state_to_scheduler(...), we check self.data[key] or self.actors[key] and then determine relevant metadata about that key like its nbytes and typ. While the code appears to handle access of self.nbytes with a fallback to using value, the access pattern using __getitem__, which would raise a KeyError if the key wasn't there. This makes one wonder if that fallback to get value is even needed here.
For context, this came up in this discussion ( #3628 (review) ).