set_last_active_at on deleted user results in AttributeError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
0. keystone stable/zed
1. You need a system with 2 scripts and a keystone user in sql, running in parallel:
Script 1 performs many authentications with username+password
Script 2 deletes the user
2. With enough luck, you get the following backtrace:
2023-11-25 19:56:10.675007 AttributeError: 'NoneType' object has no attribute 'last_active_at'
2023-11-25 19:56:10.674995 user_ref.
2023-11-25 19:56:10.674993 File "/var/lib/
I think the reason is that in some cases authentication is slower than deletion. Which results in a race condition: deletion process has finished, but authentication is still mid-execution.
Expected: keystone either finishes the authentication successfully returning the token or raises a 4xx error
Observed: keystone crashes, resulting in error 500
description: | updated |
Fix proposed to branch: master /review. opendev. org/c/openstack /keystone/ +/901885
Review: https:/