fix(caretaker): clear lock on NEEDS_HUMAN transition (#28601)

This commit is contained in:
Chad
2026-08-07 15:45:47 -05:00
committed by GitHub
parent 493113457b
commit cf22ac7e86
2 changed files with 4 additions and 0 deletions
@@ -74,6 +74,8 @@ class IssuesStore:
transaction.update(doc_ref, {
"status": "NEEDS_HUMAN",
"error": "Max triage attempts (2) exceeded due to prior worker crash or timeout",
"lock.holder": None,
"lock.expires_at": None,
"updated_at": firestore.SERVER_TIMESTAMP
})
return ClaimAction.NEEDS_HUMAN
@@ -53,6 +53,8 @@ class TestIssuesStore(unittest.TestCase):
args[1]["error"],
"Max triage attempts (2) exceeded due to prior worker crash or timeout",
)
self.assertIsNone(args[1]["lock.holder"])
self.assertIsNone(args[1]["lock.expires_at"])
def test_acquire_lock_active_lock_by_other_holder(self):
"""acquire lock when active lock held by another worker should skip"""