Minimize network roundtrip in PersonalAccessToken#redis_getdel and make it more reliable
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
As mentioned in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22916#note_117630911:
We use a Redis pipeline to do the GET and DELETE request so we don't have to make 2 network roundtrips. Redis pipelines aren't atomic, so we may need MULTI/EXEC.
There's a small possibility that if an admin creates two tokens close together, he/she sees the wrong one.
/cc @stanhu
Edited by 🤖 GitLab Bot 🤖