Key should be set in process context in order to avoid potential deadlock