Use a global variable in read_preference context manager if outside of request context.